UNPKG

57.4 kBJavaScriptView Raw
1import { CommonModule } from '@angular/common';
2import { FlexLayoutModule } from '@angular/flex-layout';
3import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4import { NgsFormModule } from '@soushians/form';
5import { HttpClient, HttpClientModule } from '@angular/common/http';
6import { __decorate, __metadata } from 'tslib';
7import { Actions, Effect, EffectsModule } from '@ngrx/effects';
8import { getUser, SignInActionTypes } from '@soushians/authentication';
9import { Observable } from 'rxjs/Observable';
10import { MatSnackBar, MatExpansionModule, MatSnackBarModule, MatIconModule, MatButtonModule, MatCardModule, MatSelectModule, MatInputModule, MatFormFieldModule, MatTabsModule, MatRadioModule } from '@angular/material';
11import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
12import { stringTemplate, MatchValidator } from '@soushians/shared';
13import { of, BehaviorSubject as BehaviorSubject$1 } from 'rxjs';
14import { getUserModuleConfig, getAppConfig } from '@soushians/config';
15import { map, filter, take, switchMap, combineLatest, catchError, takeWhile } from 'rxjs/operators';
16import { BehaviorSubject } from 'rxjs/BehaviorSubject';
17import { Router, ActivatedRoute, RouterModule } from '@angular/router';
18import { InjectionToken, Injectable, Inject, Component, Input, Output, EventEmitter, NgModule, defineInjectable, inject } from '@angular/core';
19import { Store, createSelector, createFeatureSelector, StoreModule } from '@ngrx/store';
20
21/**
22 * @fileoverview added by tsickle
23 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
24 */
25class UserModel {
26 constructor() {
27 this.Roles = [];
28 this.Groups = [];
29 }
30}
31
32/**
33 * @fileoverview added by tsickle
34 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
35 */
36/** @type {?} */
37const MODULE_DEFAULT_CONFIG = {
38 server: "frontend_server",
39 env: {
40 production: false,
41 frontend_server: "user/module/frontend/server/did/not/set",
42 server: "user/module/server/did/not/set"
43 },
44 endpoints: {
45 // resetPasswordRequest: '',
46 changePassword: "",
47 editProfile: "",
48 getAccountInfo: "",
49 profileInformation: ""
50 },
51 forms: {
52 profile_edit: ""
53 },
54 dashboardLinks: [],
55 responseToUserInfo: user$ => user$,
56 mapUserDisplayName: user$ => user$.pipe(map(user => user.Username))
57};
58/** @type {?} */
59const MODULE_CONFIG_TOKEN = new InjectionToken("UserModuleConfig");
60
61/**
62 * @fileoverview added by tsickle
63 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
64 */
65class UserConfigurationService {
66 /**
67 * @param {?} configFile
68 * @param {?} store
69 */
70 constructor(configFile, store) {
71 this.store = store;
72 this.config$ = new BehaviorSubject(this._config);
73 this._config = Object.assign({}, MODULE_DEFAULT_CONFIG, configFile);
74 this.config$.next(this._config);
75 this.store.select(getUserModuleConfig).subscribe(userConfig => {
76 if (!userConfig)
77 return;
78 this._config = Object.assign({}, this._config, userConfig.Config);
79 this.config$.next(this._config);
80 });
81 }
82 /**
83 * @return {?}
84 */
85 get config() {
86 return this._config;
87 }
88}
89UserConfigurationService.decorators = [
90 { type: Injectable, args: [{
91 providedIn: "root"
92 },] }
93];
94/** @nocollapse */
95UserConfigurationService.ctorParameters = () => [
96 { type: undefined, decorators: [{ type: Inject, args: [MODULE_CONFIG_TOKEN,] }] },
97 { type: Store }
98];
99/** @nocollapse */ UserConfigurationService.ngInjectableDef = defineInjectable({ factory: function UserConfigurationService_Factory() { return new UserConfigurationService(inject(MODULE_CONFIG_TOKEN), inject(Store)); }, token: UserConfigurationService, providedIn: "root" });
100
101/**
102 * @fileoverview added by tsickle
103 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
104 */
105/** @enum {string} */
106var ProfileViewActionTypes = {
107 GET_PROFILE: "[USER][PROFILE] GET_PROFILE",
108 GET_PROFILE_START: "[USER][PROFILE] GET_PROFILE_START",
109 GET_PROFILE_SUCCEED: "[USER][PROFILE] GET_PROFILE_SUCCEED",
110 GET_PROFILE_FAILED: "[USER][PROFILE] GET_PROFILE_FAILED",
111};
112class GetProfile {
113 constructor() {
114 this.type = ProfileViewActionTypes.GET_PROFILE;
115 }
116}
117class GetProfileStart {
118 constructor() {
119 this.type = ProfileViewActionTypes.GET_PROFILE_START;
120 }
121}
122class GetProfileSucceed {
123 /**
124 * @param {?} payload
125 */
126 constructor(payload) {
127 this.payload = payload;
128 this.type = ProfileViewActionTypes.GET_PROFILE_SUCCEED;
129 }
130}
131class GetProfileFailed {
132 constructor() {
133 this.type = ProfileViewActionTypes.GET_PROFILE_FAILED;
134 }
135}
136
137/**
138 * @fileoverview added by tsickle
139 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
140 */
141/** @enum {string} */
142var UserActionTypes = {
143 USER_SELECTED: "[USER] USER_SELECTED",
144 REFRESH_USER_INFO: "[USER] REFRESH_USER_INFO",
145};
146class RefreshUserInfoAction {
147 /**
148 * @param {?} payload
149 */
150 constructor(payload) {
151 this.payload = payload;
152 this.type = UserActionTypes.REFRESH_USER_INFO;
153 }
154}
155
156/**
157 * @fileoverview added by tsickle
158 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
159 */
160/** @type {?} */
161const initialState = {
162 loaded: false,
163 data: new UserModel()
164};
165/**
166 * @param {?=} state
167 * @param {?=} action
168 * @return {?}
169 */
170function userReducer(state = initialState, action) {
171 switch (action.type) {
172 case UserActionTypes.USER_SELECTED: {
173 return Object.assign({}, state, { loaded: true, data: action.payload });
174 }
175 case UserActionTypes.REFRESH_USER_INFO: {
176 return Object.assign({}, state, { loaded: true, data: action.payload });
177 }
178 default: {
179 return state;
180 }
181 }
182}
183/** @type {?} */
184const getAccountInfo = (state) => state.data;
185
186/**
187 * @fileoverview added by tsickle
188 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
189 */
190var ProfileViewModel;
191(function (ProfileViewModel) {
192 class Request {
193 /**
194 * @param {?=} initValue
195 */
196 constructor(initValue) {
197 Object.keys(initValue).forEach(key => (this[key] = initValue[key]));
198 }
199 /**
200 * @return {?}
201 */
202 getRequestBody() {
203 return {};
204 }
205 /**
206 * @return {?}
207 */
208 static get formGroup() {
209 return new FormGroup({
210 Username: new FormControl("", [Validators.minLength(8), Validators.required])
211 });
212 }
213 }
214 ProfileViewModel.Request = Request;
215 class Response extends UserModel {
216 constructor() {
217 super();
218 }
219 }
220 ProfileViewModel.Response = Response;
221})(ProfileViewModel || (ProfileViewModel = {}));
222
223/**
224 * @fileoverview added by tsickle
225 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
226 */
227var EditProfile_ApiModel;
228(function (EditProfile_ApiModel) {
229 class Request {
230 /**
231 * @param {?=} initValue
232 */
233 constructor(initValue = /** @type {?} */ ({})) {
234 Object.keys(initValue).forEach(key => (this[key] = initValue[key]));
235 }
236 /**
237 * @return {?}
238 */
239 getRequestBody() {
240 return this;
241 }
242 /**
243 * @return {?}
244 */
245 static get formGroup() {
246 return new FormGroup({
247 Email: new FormControl(null, [Validators.required]),
248 Roles: new FormControl(null, [Validators.required]),
249 Groups: new FormControl(null, [Validators.required])
250 });
251 }
252 }
253 EditProfile_ApiModel.Request = Request;
254 class Response {
255 /**
256 * @param {?=} initValue
257 */
258 constructor(initValue = /** @type {?} */ ({})) {
259 Object.keys(initValue).forEach(key => (this[key] = initValue[key]));
260 }
261 /**
262 * @return {?}
263 */
264 extractData() {
265 return this.Result.User;
266 }
267 }
268 EditProfile_ApiModel.Response = Response;
269})(EditProfile_ApiModel || (EditProfile_ApiModel = {}));
270
271/**
272 * @fileoverview added by tsickle
273 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
274 */
275class UserService {
276 /**
277 * @param {?} http
278 * @param {?} store
279 * @param {?} configurationService
280 */
281 constructor(http, store, configurationService) {
282 this.http = http;
283 this.store = store;
284 this.configurationService = configurationService;
285 this.configurationService.config$.subscribe(config => (this.config = config));
286 setTimeout(() => {
287 this.store.dispatch(new GetProfile());
288 }, 999);
289 }
290 /**
291 * @return {?}
292 */
293 getAccountInfo() {
294 return this.configurationService.config$.pipe(filter(config => config.endpoints.profileInformation != ""), take(1), combineLatest(this.store.select(getUser)), filter(([config, user]) => user != undefined), switchMap(([config, user]) => {
295 return this.http
296 .get(stringTemplate(config.env[config.server] + config.endpoints.profileInformation, {
297 user: user || {}
298 }))
299 .let(config.responseToUserInfo)
300 .pipe(map((response) => {
301 /** @type {?} */
302 const _user = Object.assign({}, response);
303 if (_user.Role) {
304 _user.Roles = [_user.Role];
305 }
306 return _user;
307 }), catchError(err => of(false)));
308 }));
309 }
310 /**
311 * @param {?} data
312 * @return {?}
313 */
314 editProfile(data) {
315 /** @type {?} */
316 const model = new EditProfile_ApiModel.Request(data);
317 return this.http
318 .put(stringTemplate(this.config.env[this.config.server] + this.config.endpoints.editProfile, model), model.getRequestBody())
319 .pipe(map(response => new EditProfile_ApiModel.Response(response).extractData()));
320 }
321 /**
322 * @param {?} data
323 * @return {?}
324 */
325 getInfo(data) {
326 /** @type {?} */
327 const model = new ProfileViewModel.Request(data);
328 return this.http
329 .get(stringTemplate(this.config.env[this.config.server] + this.config.endpoints.getAccountInfo, model))
330 .pipe(map(response => response));
331 }
332 /**
333 * @param {?} role
334 * @return {?}
335 */
336 is_role(role) {
337 return this.store
338 .select(getAccountInfo)
339 .pipe(filter(user => user && user.Roles != undefined), take(1), map(user => user.Roles.indexOf(role) > -1));
340 }
341}
342UserService.decorators = [
343 { type: Injectable, args: [{
344 providedIn: "root"
345 },] }
346];
347/** @nocollapse */
348UserService.ctorParameters = () => [
349 { type: HttpClient },
350 { type: Store },
351 { type: UserConfigurationService }
352];
353/** @nocollapse */ UserService.ngInjectableDef = defineInjectable({ factory: function UserService_Factory() { return new UserService(inject(HttpClient), inject(Store), inject(UserConfigurationService)); }, token: UserService, providedIn: "root" });
354
355/**
356 * @fileoverview added by tsickle
357 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
358 */
359/** @enum {string} */
360var EditProfileActionTypes = {
361 EDIT_PROFILE: "[USER][PASSWORD] EDIT_PROFILE",
362 EDIT_PROFILE_START: "[USER][PASSWORD] EDIT_PROFILE_START",
363 EDIT_PROFILE_SUCCEED: "[USER][PASSWORD] EDIT_PROFILE_SUCCEED",
364 EDIT_PROFILE_FAILED: "[USER][PASSWORD] EDIT_PROFILE_FAILED",
365};
366class EditProfile {
367 /**
368 * @param {?} payload
369 */
370 constructor(payload) {
371 this.payload = payload;
372 this.type = EditProfileActionTypes.EDIT_PROFILE;
373 }
374}
375class EditProfileStart {
376 /**
377 * @param {?} payload
378 */
379 constructor(payload) {
380 this.payload = payload;
381 this.type = EditProfileActionTypes.EDIT_PROFILE_START;
382 }
383}
384class EditProfileSucceed {
385 /**
386 * @param {?} payload
387 */
388 constructor(payload) {
389 this.payload = payload;
390 this.type = EditProfileActionTypes.EDIT_PROFILE_SUCCEED;
391 }
392}
393class EditProfileFailed {
394 constructor() {
395 this.type = EditProfileActionTypes.EDIT_PROFILE_FAILED;
396 }
397}
398
399/**
400 * @fileoverview added by tsickle
401 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
402 */
403class EditProfileEffects {
404 /**
405 * @param {?} actions$
406 * @param {?} router
407 * @param {?} service
408 */
409 constructor(actions$, router, service) {
410 this.actions$ = actions$;
411 this.router = router;
412 this.service = service;
413 this.EditProfileRequest$ = this.actions$
414 .ofType(EditProfileActionTypes.EDIT_PROFILE)
415 .pipe(map(action => action.payload), map(data => new EditProfileStart(data)));
416 this.RequestEditProfileLink$ = this.actions$
417 .ofType(EditProfileActionTypes.EDIT_PROFILE_START)
418 .pipe(map(action => action.payload), switchMap((data) => this.service.editProfile(data)), map(res => new EditProfileSucceed(res)), catchError(() => of(new EditProfileFailed())));
419 // .switchMap((data: EditProfile_ApiModel.Request) => {
420 // return this.service
421 // .editProfile(data)
422 // .map((res) => new EditProfileSucceed(res))
423 // .catch(() => of(new EditProfileFailed()));
424 // });
425 this.goToView$ = this.actions$.ofType(EditProfileActionTypes.EDIT_PROFILE_SUCCEED).pipe(map(() => {
426 this.router.navigate(["/user/profile"]);
427 return new GetProfile();
428 }));
429 }
430}
431EditProfileEffects.decorators = [
432 { type: Injectable }
433];
434/** @nocollapse */
435EditProfileEffects.ctorParameters = () => [
436 { type: Actions },
437 { type: Router },
438 { type: UserService }
439];
440__decorate([
441 Effect(),
442 __metadata("design:type", Object)
443], EditProfileEffects.prototype, "EditProfileRequest$", void 0);
444__decorate([
445 Effect(),
446 __metadata("design:type", Object)
447], EditProfileEffects.prototype, "RequestEditProfileLink$", void 0);
448__decorate([
449 Effect(),
450 __metadata("design:type", Object)
451], EditProfileEffects.prototype, "goToView$", void 0);
452
453/**
454 * @fileoverview added by tsickle
455 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
456 */
457class ProfileViewEffects {
458 /**
459 * @param {?} actions$
460 * @param {?} userService
461 */
462 constructor(actions$, userService) {
463 this.actions$ = actions$;
464 this.userService = userService;
465 this.ProfileRequest$ = this.actions$
466 .ofType(ProfileViewActionTypes.GET_PROFILE)
467 .pipe(map(action => action.payload), map(data => new GetProfileStart()));
468 this.getProfile$ = this.actions$
469 .ofType(ProfileViewActionTypes.GET_PROFILE_START)
470 .pipe(map(action => action.payload), switchMap((data) => this.userService
471 .getAccountInfo()
472 .pipe(map(res => new GetProfileSucceed(res)), catchError(() => of(new GetProfileFailed())))));
473 this.refreshUserInfo$ = this.actions$
474 .ofType(ProfileViewActionTypes.GET_PROFILE_SUCCEED)
475 .pipe(map(action => action.payload), map(data => new RefreshUserInfoAction(data)));
476 }
477}
478ProfileViewEffects.decorators = [
479 { type: Injectable }
480];
481/** @nocollapse */
482ProfileViewEffects.ctorParameters = () => [
483 { type: Actions },
484 { type: UserService }
485];
486__decorate([
487 Effect(),
488 __metadata("design:type", Object)
489], ProfileViewEffects.prototype, "ProfileRequest$", void 0);
490__decorate([
491 Effect(),
492 __metadata("design:type", Object)
493], ProfileViewEffects.prototype, "getProfile$", void 0);
494__decorate([
495 Effect(),
496 __metadata("design:type", Object)
497], ProfileViewEffects.prototype, "refreshUserInfo$", void 0);
498
499/**
500 * @fileoverview added by tsickle
501 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
502 */
503class UserEffects {
504 /**
505 * @param {?} actions$
506 * @param {?} router
507 * @param {?} service
508 */
509 constructor(actions$, router, service) {
510 this.actions$ = actions$;
511 this.router = router;
512 this.service = service;
513 // @Effect()
514 // updateProfileInformation$ = this.actions$.ofType(SignInActionTypes.SIGNIN_SUCCEED).pipe(
515 // map(action => action.payload),
516 // map(user => {
517 // return new GetProfileSucceed(user);
518 // })
519 // );
520 this.getAccountInfo$ = this.actions$.ofType(SignInActionTypes.SIGNIN_SUCCEED).pipe(map(() => {
521 return new GetProfile();
522 }));
523 this.signout$ = this.actions$
524 .ofType(SignInActionTypes.SIGNOUT)
525 .pipe(map(() => new RefreshUserInfoAction(/** @type {?} */ ({}))));
526 }
527}
528UserEffects.decorators = [
529 { type: Injectable }
530];
531/** @nocollapse */
532UserEffects.ctorParameters = () => [
533 { type: Actions },
534 { type: Router },
535 { type: UserService }
536];
537__decorate([
538 Effect(),
539 __metadata("design:type", Object)
540], UserEffects.prototype, "getAccountInfo$", void 0);
541__decorate([
542 Effect(),
543 __metadata("design:type", Object)
544], UserEffects.prototype, "signout$", void 0);
545
546/**
547 * @fileoverview added by tsickle
548 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
549 */
550/** @enum {string} */
551var ResetPasswordRequestActionTypes = {
552 GET_RESET_PASSWORD_LINK: "[USER][PASSWORD] GET_RESET_PASSWORD_LINK",
553 RESET_PASSWORD_LINK_REQUEST_START: "[USER][PASSWORD] RESET_PASSWORD_LINK_REQUEST_START",
554 RESET_PASSWORD_LINK_REQUEST_SUCCEED: "[USER][PASSWORD] RESET_PASSWORD_LINK_REQUEST_SUCCEED",
555 RESET_PASSWORD_LINK_REQUEST_FAILED: "[USER][PASSWORD] RESET_PASSWORD_LINK_REQUEST_FAILED",
556 DISABLE_GET_LINK: "[USER][PASSWORD] DISABLE_GET_LINK",
557 ENABLE_GET_LINK: "[USER][PASSWORD] ENABLE_GET_LINK",
558 MAXIMUM_TRY_HAPPEND: "[USER][PASSWORD] MAXIMUM_TRY_HAPPEND",
559 PASSWORD_CHANGED_SUCCEED: "[USER][PASSWORD] PASSWORD_CHANGED_SUCCEED",
560 PASSWORD_CHANGED_FAILED: "[USER][PASSWORD] PASSWORD_CHANGED_FAILED",
561};
562
563/**
564 * @fileoverview added by tsickle
565 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
566 */
567/** @type {?} */
568const initialState$1 = {
569 numberOfRequested: 0,
570 lastRequestedTime: null,
571 disable: false
572};
573/**
574 * @param {?=} state
575 * @param {?=} action
576 * @return {?}
577 */
578function reducer(state = initialState$1, action) {
579 switch (action.type) {
580 case ResetPasswordRequestActionTypes.GET_RESET_PASSWORD_LINK: {
581 return Object.assign({}, state);
582 }
583 case ResetPasswordRequestActionTypes.RESET_PASSWORD_LINK_REQUEST_START: {
584 return Object.assign({}, state, { numberOfRequested: state.numberOfRequested + 1, lastRequestedTime: Date.now().toString() });
585 }
586 case ResetPasswordRequestActionTypes.RESET_PASSWORD_LINK_REQUEST_SUCCEED: {
587 return Object.assign({}, state);
588 }
589 case ResetPasswordRequestActionTypes.DISABLE_GET_LINK: {
590 return Object.assign({}, state, { disable: true });
591 }
592 case ResetPasswordRequestActionTypes.ENABLE_GET_LINK: {
593 return Object.assign({}, state, { disable: false });
594 }
595 default: {
596 return state;
597 }
598 }
599}
600/** @type {?} */
601var getNumberOfRequeseted = (state) => state.numberOfRequested;
602/** @type {?} */
603var getStatus = (state) => state.disable;
604
605/**
606 * @fileoverview added by tsickle
607 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
608 */
609/** @enum {string} */
610var ChangePasswordActionTypes = {
611 CHANGE_PASSWORD: "[USER][PASSWORD] CHANGE_PASSWORD",
612 PASSWORD_CHANGED_START: "[USER][PASSWORD] PASSWORD_CHANGED_START",
613 PASSWORD_CHANGED_SUCCEED: "[USER][PASSWORD] PASSWORD_CHANGED_SUCCEED",
614 PASSWORD_CHANGED_FAILED: "[USER][PASSWORD] PASSWORD_CHANGED_FAILED",
615};
616class ChangePassword {
617 /**
618 * @param {?} payload
619 */
620 constructor(payload) {
621 this.payload = payload;
622 this.type = ChangePasswordActionTypes.CHANGE_PASSWORD;
623 }
624}
625
626/**
627 * @fileoverview added by tsickle
628 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
629 */
630/** @type {?} */
631const initialState$2 = {
632 status: "pristine"
633};
634/**
635 * @param {?=} state
636 * @param {?=} action
637 * @return {?}
638 */
639function reducer$1(state = initialState$2, action) {
640 switch (action.type) {
641 case ChangePasswordActionTypes.CHANGE_PASSWORD: {
642 return {
643 status: "dirty"
644 };
645 }
646 case ChangePasswordActionTypes.PASSWORD_CHANGED_START: {
647 return {
648 status: "pending"
649 };
650 }
651 case ChangePasswordActionTypes.PASSWORD_CHANGED_SUCCEED: {
652 return {
653 status: "succeed"
654 };
655 }
656 case ChangePasswordActionTypes.PASSWORD_CHANGED_FAILED: {
657 return {
658 status: "failed"
659 };
660 }
661 default: {
662 return initialState$2;
663 }
664 }
665}
666
667/**
668 * @fileoverview added by tsickle
669 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
670 */
671/** @type {?} */
672const initialState$3 = {
673 status: "pristine"
674};
675/**
676 * @param {?=} state
677 * @param {?=} action
678 * @return {?}
679 */
680function reducer$2(state = initialState$3, action) {
681 switch (action.type) {
682 case EditProfileActionTypes.EDIT_PROFILE: {
683 return {
684 status: "dirty"
685 };
686 }
687 case EditProfileActionTypes.EDIT_PROFILE_START: {
688 return {
689 status: "pending"
690 };
691 }
692 case EditProfileActionTypes.EDIT_PROFILE_SUCCEED: {
693 return {
694 status: "succeed"
695 };
696 }
697 case EditProfileActionTypes.EDIT_PROFILE_FAILED: {
698 return {
699 status: "failed"
700 };
701 }
702 default: {
703 return state;
704 }
705 }
706}
707
708/**
709 * @fileoverview added by tsickle
710 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
711 */
712/** @enum {string} */
713var SearchActionTypes = {
714 SEARCH: "[USER][SEARCH] SEARCH",
715 SEARCH_START: "[USER][SEARCH] SEARCH_START",
716 SEARCH_SUCCEED: "[USER][SEARCH] SEARCH_SUCCEED",
717 SEARCH_FAILED: "[USER][SEARCH] SEARCH_FAILED",
718 CLEAR_SEARCHED_USER: "[USER][SEARCH] CLEAR_SEARCHED_USER",
719};
720class Search {
721 /**
722 * @param {?} payload
723 */
724 constructor(payload) {
725 this.payload = payload;
726 this.type = SearchActionTypes.SEARCH;
727 }
728}
729
730/**
731 * @fileoverview added by tsickle
732 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
733 */
734/** @type {?} */
735const initialState$4 = {
736 status: "pristine",
737 data: /** @type {?} */ ({})
738};
739/**
740 * @param {?=} state
741 * @param {?=} action
742 * @return {?}
743 */
744function reducer$3(state = initialState$4, action) {
745 switch (action.type) {
746 case SearchActionTypes.SEARCH: {
747 return Object.assign({}, state, { status: "dirty", data: new ProfileViewModel.Response() });
748 }
749 case SearchActionTypes.SEARCH_START: {
750 return Object.assign({}, state, { status: "pending" });
751 }
752 case SearchActionTypes.SEARCH_SUCCEED: {
753 return Object.assign({}, state, { status: "succeed", data: action.payload });
754 }
755 case SearchActionTypes.SEARCH_FAILED: {
756 return Object.assign({}, state, { status: "failed" });
757 }
758 case SearchActionTypes.CLEAR_SEARCHED_USER: {
759 return initialState$4;
760 }
761 default: {
762 return state;
763 }
764 }
765}
766/** @type {?} */
767var getStatus$3 = (state) => state.status;
768
769/**
770 * @fileoverview added by tsickle
771 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
772 */
773/** @type {?} */
774const UserReducers = {
775 user: userReducer,
776 resetPasswordRequest: reducer,
777 changePassword: reducer$1,
778 searchView: reducer$3,
779 editProfile: reducer$2
780};
781/** @type {?} */
782const selectFeatureState = createFeatureSelector("user");
783/** @type {?} */
784const getUserInforamtionStatus = createSelector(selectFeatureState, (state) => state.user.loaded);
785/** @type {?} */
786const isSignedIn = createSelector(selectFeatureState, (state) => state.user.loaded);
787/** @type {?} */
788const selectResetPasswordRequestState = createSelector(selectFeatureState, (state) => state.resetPasswordRequest);
789/** @type {?} */
790const getNumberOfRequeseted$1 = createSelector(selectResetPasswordRequestState, getNumberOfRequeseted);
791/** @type {?} */
792const getResetPasswordRequestStatus = createSelector(selectResetPasswordRequestState, getStatus);
793/** @type {?} */
794const selectUserInformaionState = createSelector(selectFeatureState, (state) => state.user);
795/** @type {?} */
796const getAccountInfo$2 = createSelector(selectUserInformaionState, getAccountInfo);
797/** @type {?} */
798const selectSearchState = createSelector(selectFeatureState, (state) => state.searchView);
799/** @type {?} */
800const getSearchStatus = createSelector(selectSearchState, getStatus$3);
801//#endregion
802
803/**
804 * @fileoverview added by tsickle
805 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
806 */
807class SearchComponent {
808 /**
809 * @param {?} store
810 */
811 constructor(store) {
812 this.store = store;
813 this.formGroup = ProfileViewModel.Request.formGroup;
814 this.userDataLoaded$ = new BehaviorSubject$1(false);
815 this.userNotFound$ = new BehaviorSubject$1(false);
816 this.user = this.store.select(getAccountInfo$2);
817 this.userStatus$ = this.store.select(getSearchStatus);
818 }
819 /**
820 * @return {?}
821 */
822 ngOnInit() {
823 this.userStatus$.subscribe(value => this.userDataLoaded$.next(!"pristine|dirty|pending".includes(value)));
824 }
825 /**
826 * @return {?}
827 */
828 search() {
829 if (!this.formGroup.valid)
830 return;
831 this.store.dispatch(new Search(this.formGroup.value));
832 }
833}
834SearchComponent.decorators = [
835 { type: Component, args: [{
836 selector: "search",
837 template: "<mat-card fxFlex=\"450px\" *ngIf=\"(userStatus$ | async) == 'succeed'\">\r\n <mat-card-header>\r\n <mat-card-title>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"space-between\">\r\n <div fxFlex=\"nogrow\">\r\n <!-- {{(user | async).LastName }}\u060C {{(user | async).FirstName }} -->\r\n </div>\r\n <div fxFlex=\"nogrow\">\r\n <!-- {{(user | async).Email}} -->\r\n </div>\r\n </div>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div>\r\n <div class='list-item' fxFlexLayout='row' fxLayoutAlign='center center'>\r\n <mat-icon fxFlex='nogrow'>local_grocery_store</mat-icon>\r\n <div fxFlex='15px'></div>\r\n <p fxFlex='40'>\u0634\u0646\u0627\u0633\u0647</p>\r\n <!-- <p fxFlex='60' fxLayoutAlign=\"end\">{{(user | async)._id }}</p> -->\r\n </div>\r\n <div class='list-item' fxFlexLayout='row' fxLayoutAlign='center center'>\r\n <mat-icon fxFlex='nogrow'>email</mat-icon>\r\n <div fxFlex='15px'></div>\r\n <p fxFlex='40'>\u067E\u0633\u062A \u0627\u0644\u06A9\u062A\u0631\u0648\u0646\u06CC\u06A9\u06CC</p>\r\n <!-- <p fxFlex='60' fxLayoutAlign=\"end\">{{(user | async).Email }}</p> -->\r\n </div>\r\n </div>\r\n\r\n </mat-card-content>\r\n</mat-card>",
838 styles: [""]
839 }] }
840];
841/** @nocollapse */
842SearchComponent.ctorParameters = () => [
843 { type: Store }
844];
845
846/**
847 * @fileoverview added by tsickle
848 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
849 */
850class ChangePasswordComponent {
851 constructor() {
852 this.submited = new EventEmitter();
853 }
854 /**
855 * @return {?}
856 */
857 ngOnInit() { }
858 /**
859 * @return {?}
860 */
861 submit() { }
862 /**
863 * @return {?}
864 */
865 changePassword() {
866 if (!this.formGroup.valid)
867 return;
868 this.submited.emit(this.formGroup.value);
869 }
870}
871ChangePasswordComponent.decorators = [
872 { type: Component, args: [{
873 selector: "user-change-password",
874 template: "<div fxFlex=\"450px\">\r\n <form [formGroup]=\"formGroup\" (ngSubmit)=\"changePassword()\" fxLayout=\"column\">\r\n <mat-card>\r\n <mat-card-content>\r\n <mat-form-field fxFlexFill>\r\n <input type=\"password\" matInput placeholder=\"\u06A9\u0644\u0645\u0647 \u0639\u0628\u0648\u0631\" formControlName=\"Password\">\r\n </mat-form-field>\r\n <mat-form-field fxFlexFill>\r\n <input type=\"password\" matInput placeholder=\"\u062A\u06A9\u0631\u0627\u0631 \u06A9\u0644\u0645\u0647 \u0639\u0628\u0648\u0631\" formControlName=\"Confirm\">\r\n </mat-form-field>\r\n </mat-card-content>\r\n <mat-card-actions fxLayoutAlign=\"center center\">\r\n <button fxFlex=\"nogrow\" type=\"submit\" mat-raised-button color=\"primary\">\u062A\u063A\u06CC\u06CC\u0631 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631</button>\r\n <button fxFlex=\"nogrow\" type=\"button\" routerLink=\"/user/panel\" mat-raised-button>\u0628\u0627\u0632\u06AF\u0634\u062A</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n </form>\r\n</div>",
875 styles: [""]
876 }] }
877];
878/** @nocollapse */
879ChangePasswordComponent.ctorParameters = () => [];
880ChangePasswordComponent.propDecorators = {
881 formGroup: [{ type: Input }],
882 submited: [{ type: Output }]
883};
884
885/**
886 * @fileoverview added by tsickle
887 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
888 */
889class ProfileEditComponent {
890 /**
891 * @param {?} router
892 */
893 constructor(router) {
894 this.router = router;
895 this.submited = new EventEmitter();
896 }
897 /**
898 * @return {?}
899 */
900 ngOnInit() { }
901 /**
902 * @param {?} form
903 * @return {?}
904 */
905 editProfile(form) {
906 if (!form.valid)
907 return;
908 this.submited.emit(form.value);
909 }
910 /**
911 * @return {?}
912 */
913 goback() {
914 this.router.navigate([".."]);
915 }
916}
917ProfileEditComponent.decorators = [
918 { type: Component, args: [{
919 selector: "profile-edit",
920 template: "<div fxFlex=\"450px\">\r\n\r\n \r\n <ngs-form-view #form [id]=\"formId\" [card]=\"true\" (accept)=\"editProfile(form.formGroup)\" (cancel)=\"goback()\" ></ngs-form-view>\r\n <!-- <form [formGroup]=\"formGroup\" (ngSubmit)=\"editProfile()\" fxLayout=\"column\">\r\n <mat-card>\r\n <mat-card-content>\r\n </mat-card-content>\r\n <mat-card-actions align=\"end\">\r\n <button type=\"button\" routerLink=\"..\" mat-button color=\"primary\">\u0628\u0627\u0632\u06AF\u0634\u062A</button>\r\n <button type=\"submit\" mat-raised-button color=\"primary\">\u0648\u06CC\u0631\u0627\u06CC\u0634</button>\r\n </mat-card-actions>\r\n </mat-card>\r\n </form> -->\r\n</div>"
921 }] }
922];
923/** @nocollapse */
924ProfileEditComponent.ctorParameters = () => [
925 { type: Router }
926];
927ProfileEditComponent.propDecorators = {
928 submited: [{ type: Output }],
929 userInfo: [{ type: Input }],
930 formId: [{ type: Input }],
931 roles$: [{ type: Input, args: ["roles",] }],
932 groups: [{ type: Input }]
933};
934
935/**
936 * @fileoverview added by tsickle
937 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
938 */
939class DashboardLinksComponent {
940 /**
941 * @param {?} userConfigurationService
942 * @param {?} store
943 */
944 constructor(userConfigurationService, store) {
945 this.userConfigurationService = userConfigurationService;
946 this.store = store;
947 this.links$ = this.userConfigurationService.config$.pipe(map(data => data.dashboardLinks));
948 this.links = [
949 {
950 title: "مشاهده حساب کاربری",
951 route: "/user/panel/profile",
952 // description: "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم",
953 icon: "person"
954 }
955 ];
956 }
957 /**
958 * @return {?}
959 */
960 ngAfterViewInit() { }
961}
962DashboardLinksComponent.decorators = [
963 { type: Component, args: [{
964 selector: "user-dashboard-links",
965 template: "<div fxLayout='row' fxLayoutWrap id=\"con\">\r\n <button fxFlex=\"31\" class='link' mat-raised-button [routerLink]='link.route' *ngFor='let link of links'>\r\n <div fxLayout='column' fxLayoutAlign='center center'>\r\n <mat-icon color='primary'>{{link.icon}}</mat-icon>\r\n <h3 class='title'>{{link.title}}</h3>\r\n <div class='description'>{{link.description}}</div>\r\n </div>\r\n </button>\r\n <button fxFlex=\"31\" class='link' mat-raised-button [routerLink]='link.route' *ngFor='let link of links$ | async'>\r\n <div fxLayout='column' fxLayoutAlign='center center'>\r\n <mat-icon color='primary'>{{link.icon}}</mat-icon>\r\n <h3 class='title'>{{link.title}}</h3>\r\n <div class='description'>{{link.description}}</div>\r\n </div>\r\n </button>\r\n</div>",
966 styles: ["#con [fxflex]{margin-right:25px}:host{width:100%;padding:25px 25px 0}button mat-icon{font-size:48px;width:48px;height:48px}button.link{padding:25px 15px;margin-bottom:25px}.title{margin-top:0;margin-bottom:5px}.description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:90%}"]
967 }] }
968];
969/** @nocollapse */
970DashboardLinksComponent.ctorParameters = () => [
971 { type: UserConfigurationService },
972 { type: Store }
973];
974
975/**
976 * @fileoverview added by tsickle
977 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
978 */
979class ResetPasswordRequestComponent {
980 /**
981 * @param {?} snackBar
982 */
983 constructor(snackBar) {
984 this.snackBar = snackBar;
985 this.submitted = new EventEmitter();
986 this.maximumResendingHappend$ = new BehaviorSubject(false);
987 this.timer$ = Observable.timer(0, 100).pipe(map(i => i + 1), takeWhile(i => i * 100 <= 3000), map(i => 3000 - i * 100));
988 }
989 /**
990 * @param {?} isPending
991 * @return {?}
992 */
993 set pending(isPending) {
994 if (isPending) {
995 this.formGroup.disable();
996 }
997 this.formGroup.enable();
998 }
999 /**
1000 * @return {?}
1001 */
1002 ngOnInit() {
1003 this.numberOfRequested.subscribe(data => {
1004 if (data > 2) {
1005 this.maximumResendingHappend$.next(true);
1006 }
1007 });
1008 }
1009 /**
1010 * @return {?}
1011 */
1012 submit() {
1013 if (this.formGroup.valid) {
1014 this.submitted.emit(this.formGroup.value);
1015 /** @type {?} */
1016 let message = this.maximumResendingHappend$.getValue()
1017 ? "عدم امکان ..."
1018 : "پیامک جدید برای شما ارسال گردید.";
1019 this.snackBar.open(message, "", {
1020 duration: 3000
1021 });
1022 }
1023 }
1024}
1025ResetPasswordRequestComponent.decorators = [
1026 { type: Component, args: [{
1027 selector: "user-reset-password-request",
1028 template: "<form [formGroup]=\"formGroup\" (ngSubmit)=\"submit()\" fxLayout=\"column\">\r\n <mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\r\n <h3>\u062F\u0631\u062E\u0648\u0627\u0633\u062A \u0628\u0627\u0632\u06CC\u0627\u0628\u06CC \u0631\u0645\u0632 \u0639\u0628\u0648\u0631</h3>\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <p>\u0628\u0631\u0627\u06CC \u0628\u0627\u0632\u06CC\u0627\u0628\u06CC \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0634\u0645\u0627\u0631\u0647 \u062A\u0644\u0641\u0646 \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u0646\u0645\u0627\u06CC\u06CC\u062F</p>\r\n <mat-radio-group fxFlexFill formControlName=\"Type\">\r\n <mat-radio-button value=\"sms\">\u067E\u06CC\u0627\u0645\u06A9</mat-radio-button>\r\n <mat-radio-button value=\"email\">\u067E\u0633\u062A \u0627\u0644\u06A9\u062A\u0631\u0648\u0646\u06CC\u06A9\u06CC</mat-radio-button>\r\n </mat-radio-group>\r\n <mat-form-field fxFlexFill>\r\n <input matInput placeholder=\"\u0634\u0645\u0627\u0631\u0647 \u062A\u0644\u0641\u0646 \u0647\u0645\u0631\u0627\u0647\" formControlName=\"Username\">\r\n </mat-form-field>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <!--<button type=\"submit\" [disabled]='(canRequestPin | async) || (maximumResendingHappend$ | async)' (click)=\"submit()\" mat-raised-button color=\"primary\">-->\r\n <button type=\"submit\" [disabled]='(canRequestPin | async)' (click)=\"submit()\" mat-raised-button color=\"primary\">\r\n <span *ngIf='!(canRequestPin | async)'>\r\n \u0628\u0627\u0632\u06CC\u0627\u0628\u06CC \u0631\u0645\u0632 \u0639\u0628\u0648\u0631\r\n </span>\r\n <!--<div *ngIf='(canRequestPin | async) && !(maximumResendingHappend$ | async)'>\r\n {{timer$ | async}} \u062B\u0627\u0646\u06CC\u0647 \u062A\u0627 \u0627\u0645\u06A9\u0627\u0646 \u062F\u0631 \u062E\u0648\u0627\u0633\u062A \u062F\u0648\u0628\u0627\u0631\u0647 \u062F\u0631\u06CC\u0627\u0641\u062A \u067E\u06CC\u0627\u0645\u06A9.\r\n </div>\r\n <div *ngIf='(maximumResendingHappend$ | async)'>\r\n \u0639\u062F\u0645 \u0627\u0645\u06A9\u0627\u0646 \u062F\u0631\u062E\u0648\u0627\u0633\u062A\r\n </div>-->\r\n </button>\r\n <a mat-button routerLink='/auth/signin'>\u0627\u0646\u0635\u0631\u0627\u0641</a>\r\n </mat-card-actions>\r\n </mat-card>\r\n</form>\r\n",
1029 styles: [""]
1030 }] }
1031];
1032/** @nocollapse */
1033ResetPasswordRequestComponent.ctorParameters = () => [
1034 { type: MatSnackBar }
1035];
1036ResetPasswordRequestComponent.propDecorators = {
1037 submitted: [{ type: Output }],
1038 formGroup: [{ type: Input }],
1039 numberOfRequested: [{ type: Input }],
1040 canRequestPin: [{ type: Input }],
1041 pending: [{ type: Input }]
1042};
1043
1044/**
1045 * @fileoverview added by tsickle
1046 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1047 */
1048class FeatureContainerComponent {
1049 /**
1050 * @param {?} route
1051 * @param {?} store
1052 */
1053 constructor(route, store) {
1054 this.route = route;
1055 this.store = store;
1056 this.route.params.subscribe(params => {
1057 /** @type {?} */
1058 let model = new ProfileViewModel.Request(/** @type {?} */ ({ Email: params["Email"] }));
1059 this.store.dispatch(new Search(model));
1060 });
1061 }
1062}
1063FeatureContainerComponent.decorators = [
1064 { type: Component, args: [{
1065 template: "<router-outlet></router-outlet>"
1066 }] }
1067];
1068/** @nocollapse */
1069FeatureContainerComponent.ctorParameters = () => [
1070 { type: ActivatedRoute },
1071 { type: Store }
1072];
1073
1074/**
1075 * @fileoverview added by tsickle
1076 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1077 */
1078var ChangePasswordModel;
1079(function (ChangePasswordModel) {
1080 class Request {
1081 /**
1082 * @param {?=} initValue
1083 */
1084 constructor(initValue = /** @type {?} */ ({})) {
1085 Object.keys(initValue).forEach(key => (this[key] = initValue[key]));
1086 }
1087 /**
1088 * @return {?}
1089 */
1090 getRequestBody() {
1091 return {
1092 Password: this.Password
1093 };
1094 }
1095 /**
1096 * @return {?}
1097 */
1098 static get formGroup() {
1099 return new FormGroup({
1100 Password: new FormControl(null, [Validators.required, Validators.minLength(7)]),
1101 Confirm: new FormControl(null, [Validators.required, MatchValidator("Password")])
1102 });
1103 }
1104 }
1105 ChangePasswordModel.Request = Request;
1106 class Response {
1107 constructor() { }
1108 }
1109 ChangePasswordModel.Response = Response;
1110})(ChangePasswordModel || (ChangePasswordModel = {}));
1111
1112/**
1113 * @fileoverview added by tsickle
1114 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1115 */
1116class ChangePasswordContainerComponent {
1117 /**
1118 * @param {?} route
1119 * @param {?} store
1120 */
1121 constructor(route, store) {
1122 this.route = route;
1123 this.store = store;
1124 this.formGroup = ChangePasswordModel.Request.formGroup;
1125 this.ChangePasswordModel = new ChangePasswordModel.Request();
1126 }
1127 /**
1128 * @return {?}
1129 */
1130 ngOnInit() {
1131 this.store.select(getAccountInfo$2).subscribe(userInfo => {
1132 if (!userInfo)
1133 return;
1134 // TODO:
1135 // this.ChangePasswordModel.Username = userInfo.Username;
1136 });
1137 }
1138 /**
1139 * @param {?} event
1140 * @return {?}
1141 */
1142 changePassword(event) {
1143 this.ChangePasswordModel.Password = this.formGroup.get("Password").value;
1144 this.store.dispatch(new ChangePassword(this.ChangePasswordModel));
1145 }
1146}
1147ChangePasswordContainerComponent.decorators = [
1148 { type: Component, args: [{
1149 template: `<user-change-password
1150 (submited)='changePassword($event)'
1151 [formGroup]="formGroup"
1152 ></user-change-password>`
1153 }] }
1154];
1155/** @nocollapse */
1156ChangePasswordContainerComponent.ctorParameters = () => [
1157 { type: ActivatedRoute },
1158 { type: Store }
1159];
1160
1161/**
1162 * @fileoverview added by tsickle
1163 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1164 */
1165class ProfileEditContainerComponent {
1166 /**
1167 * @param {?} store
1168 * @param {?} configService
1169 */
1170 constructor(store, configService) {
1171 this.store = store;
1172 this.configService = configService;
1173 this.userInforamation$ = this.store.select(getAccountInfo$2);
1174 this.roles$ = this.store
1175 .select(getAppConfig)
1176 .pipe(filter(config => config != undefined), map(config => config.Config.Roles));
1177 // TODO:
1178 // this.groups = this.diagramService.getGroups();
1179 this.groups = of(["test1", "test2"]);
1180 this.config$ = this.configService.config$;
1181 }
1182 /**
1183 * @return {?}
1184 */
1185 ngOnInit() { }
1186 /**
1187 * @param {?} data
1188 * @return {?}
1189 */
1190 updateProfile(data) {
1191 this.store.dispatch(new EditProfile(data));
1192 }
1193}
1194ProfileEditContainerComponent.decorators = [
1195 { type: Component, args: [{
1196 selector: "profile-edit-contianer",
1197 template: `<profile-edit
1198 (submited)='updateProfile($event)'
1199 [userInfo]="userInforamation$ | async"
1200 [roles]="roles$"
1201 [groups]="groups | async"
1202 [formId]="(config$|async)?.forms.profile_edit"
1203 ></profile-edit>`
1204 }] }
1205];
1206/** @nocollapse */
1207ProfileEditContainerComponent.ctorParameters = () => [
1208 { type: Store },
1209 { type: UserConfigurationService }
1210];
1211
1212/**
1213 * @fileoverview added by tsickle
1214 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1215 */
1216class DashboardContainerComponent {
1217 /**
1218 * @param {?} store
1219 */
1220 constructor(store) {
1221 this.store = store;
1222 this.user$ = this.store.select(getAccountInfo);
1223 // this.is_agent = signinService.is_agent();
1224 }
1225 /**
1226 * @return {?}
1227 */
1228 ngOnInit() { }
1229}
1230DashboardContainerComponent.decorators = [
1231 { type: Component, args: [{
1232 selector: "user-dashboard-container",
1233 template: "<!-- <router-outlet name=\"links\"></router-outlet> -->\r\n<div fxLayoutAlign=\"center\">\r\n <router-outlet></router-outlet>\r\n</div>",
1234 styles: ["#box-left{background:#fff}#box-bottom{background:#2b0033}#box-right{background:#000833;padding-top:10px!important;padding-bottom:10px!important}#box-right div{background:#fff;opacity:.5}#banner:not(.active){height:100%;-webkit-filter:grayscale(100%) brightness(1.5) opacity(.2) blur(2px);filter:grayscale(100%) brightness(1.5) opacity(.2) blur(2px)}#s1{background:#aaa}#s2{background:#bbb}#s3{background:#ccc}.personal-info{background-color:rgba(255,255,255,.5);position:relative;right:10%;width:90%;height:469px}.personal-info h2{color:#00bcd4;font-weight:400;font-size:24px;font-family:iran-sans-light!important}.personal-info h6{font-weight:400;font-size:12px;float:right;width:50%;margin:0;color:#555;border-bottom:2px solid #ececec}.personal-info p{float:right;width:30%;margin:0;font-size:13px;padding-right:30px;border-bottom:2px solid #ececec}.personal-info div{width:100%;height:50px;position:relative;line-height:52px;right:17px}.quick-box{width:100%;height:50px;position:relative;line-height:52px;padding-top:79px}.quick-btn{background-color:#00bcd4;margin:12px 10px;height:100px;text-align:center;line-height:100px;font-size:17px;color:#fff}.banner-section{text-align:center}.info-section{padding:60px 25px 10px;background-color:#f7f7f7;background-image:url(https://www.toptal.com/designers/subtlepatterns/patterns/grey.png)!important;height:1040px;padding-bottom:120px!important}"]
1235 }] }
1236];
1237/** @nocollapse */
1238DashboardContainerComponent.ctorParameters = () => [
1239 { type: Store }
1240];
1241
1242/**
1243 * @fileoverview added by tsickle
1244 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1245 */
1246class ProfileComponent {
1247 constructor() {
1248 this.info = [];
1249 }
1250 /**
1251 * @param {?} information
1252 * @return {?}
1253 */
1254 set information(information) {
1255 if (!information)
1256 return;
1257 Object.keys(information).forEach(k => this.info.push([k, information[k]]));
1258 }
1259 /**
1260 * @return {?}
1261 */
1262 ngOnInit() { }
1263}
1264ProfileComponent.decorators = [
1265 { type: Component, args: [{
1266 selector: "user-profile",
1267 template: "<div fxFlex=\"450px\">\r\n <router-outlet name=\"ngs-user-profile-view\"></router-outlet>\r\n <router-outlet></router-outlet>\r\n <!-- <mat-card>\r\n <mat-card-header>\r\n <mat-card-title>\u0627\u0637\u0644\u0627\u0639\u0627\u062A \u067E\u0631\u0648\u0641\u0627\u06CC\u0644</mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content *ngIf='dataStatus$ | async'>\r\n <div class='list-item' fxFlexLayout='row' *ngFor=\"let item of info\">\r\n <p fxFlex='40'>{{item[0]}}</p>\r\n <p fxFlex='60'>{{item[1]}}</p>\r\n </div>\r\n \r\n </mat-card-content>\r\n\r\n <mat-card-actions align=\"end\">\r\n <button mat-button color=\"primary\" routerLink='..'>\u0628\u0627\u0632\u06AF\u0634\u062A</button>\r\n <button mat-raised-button color=\"primary\" routerLink='edit'>\u0648\u06CC\u0631\u0627\u06CC\u0634</button>\r\n </mat-card-actions>\r\n </mat-card> -->\r\n</div>\r\n\r\n\r\n\r\n<!-- <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u0627\u06CC\u0645\u06CC\u0644</p>\r\n <p fxFlex='60'>{{(information | async).Email}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>roles</p>\r\n <p fxFlex='60'>{{(information | async).Roles | json}}</p>\r\n </div> -->\r\n<!-- <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u0646\u0627\u0645</p>\r\n <p fxFlex='60'>{{(userInformation | async).FirstName}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u0646\u0627\u0645 \u062E\u0627\u0646\u0648\u0627\u062F\u06AF\u06CC</p>\r\n <p fxFlex='60'>{{(userInformation | async).LastName}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u0646\u0627\u0645 \u06A9\u0627\u0631\u0628\u0631\u06CC</p>\r\n <p fxFlex='60'>{{(userInformation | async).Username}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u062A\u0644\u0641\u0646 \u0647\u0645\u0631\u0627\u0647</p>\r\n <p fxFlex='60'>{{(userInformation | async).MobileNumber | persianNumber}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u062C\u0646\u0633\u06CC\u062A</p>\r\n <p fxFlex='60'>{{sex$ | async}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u062A\u0627\u0631\u06CC\u062E \u062A\u0648\u0644\u062F</p>\r\n <p fxFlex='60'>{{(userInformation | async).Birthdate | persianDate : false}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u0627\u06CC\u0645\u06CC\u0644</p>\r\n <p fxFlex='60'>{{(userInformation | async).Email}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>{{(identifierType$ | async)}}</p>\r\n <p fxFlex='60'>{{(userInformation | async).IdentificationNo | persianNumber}}</p>\r\n </div>\r\n <div class='list-item' fxFlexLayout='row'>\r\n <p fxFlex='40'>\u062A\u0627\u0631\u06CC\u062E \u0639\u0636\u0648\u06CC\u062A</p>\r\n <p fxFlex='60'>{{(userInformation | async).RegisterDate | persianDate}}</p>\r\n </div> -->",
1268 styles: [""]
1269 }] }
1270];
1271/** @nocollapse */
1272ProfileComponent.ctorParameters = () => [];
1273ProfileComponent.propDecorators = {
1274 information: [{ type: Input }],
1275 dataStatus$: [{ type: Input }]
1276};
1277
1278/**
1279 * @fileoverview added by tsickle
1280 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1281 */
1282class ProfileContainerComponent {
1283 /**
1284 * @param {?} store
1285 */
1286 constructor(store) {
1287 this.store = store;
1288 this.data$ = this.store.select(getAccountInfo$2);
1289 this.dataStatus$ = this.store.select(getUserInforamtionStatus);
1290 }
1291 /**
1292 * @return {?}
1293 */
1294 ngOnInit() { }
1295}
1296ProfileContainerComponent.decorators = [
1297 { type: Component, args: [{
1298 template: `<user-profile
1299 [information]="data$ | async"
1300 [dataStatus$]='dataStatus$'
1301 ></user-profile>`
1302 }] }
1303];
1304/** @nocollapse */
1305ProfileContainerComponent.ctorParameters = () => [
1306 { type: Store }
1307];
1308
1309/**
1310 * @fileoverview added by tsickle
1311 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1312 */
1313class NgsUserModule {
1314 /**
1315 * @param {?=} config
1316 * @return {?}
1317 */
1318 static forRoot(config) {
1319 return {
1320 ngModule: RootNgsUserModule,
1321 providers: [{ provide: MODULE_CONFIG_TOKEN, useValue: config }]
1322 };
1323 }
1324}
1325NgsUserModule.decorators = [
1326 { type: NgModule, args: [{
1327 imports: [
1328 HttpClientModule,
1329 FormsModule,
1330 RouterModule,
1331 CommonModule,
1332 MatExpansionModule,
1333 MatSnackBarModule,
1334 MatIconModule,
1335 MatButtonModule,
1336 MatCardModule,
1337 MatSelectModule,
1338 MatInputModule,
1339 MatFormFieldModule,
1340 MatTabsModule,
1341 FlexLayoutModule,
1342 MatRadioModule,
1343 ReactiveFormsModule,
1344 BrowserAnimationsModule,
1345 NgsFormModule
1346 ],
1347 declarations: [
1348 SearchComponent,
1349 ProfileComponent,
1350 ChangePasswordComponent,
1351 ProfileEditComponent,
1352 ProfileContainerComponent,
1353 DashboardLinksComponent,
1354 ResetPasswordRequestComponent,
1355 FeatureContainerComponent,
1356 DashboardContainerComponent,
1357 ChangePasswordContainerComponent,
1358 ProfileEditContainerComponent
1359 ],
1360 exports: []
1361 },] }
1362];
1363class RootNgsUserModule {
1364}
1365RootNgsUserModule.decorators = [
1366 { type: NgModule, args: [{
1367 imports: [
1368 NgsUserModule,
1369 StoreModule.forFeature("user", UserReducers),
1370 EffectsModule.forFeature([
1371 EditProfileEffects,
1372 ProfileViewEffects,
1373 UserEffects
1374 ])
1375 ]
1376 },] }
1377];
1378
1379/**
1380 * @fileoverview added by tsickle
1381 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1382 */
1383/** @type {?} */
1384const routes = [
1385 {
1386 path: "user/panel",
1387 component: DashboardContainerComponent,
1388 children: [
1389 {
1390 path: "",
1391 component: DashboardLinksComponent
1392 },
1393 {
1394 path: "profile",
1395 component: ProfileContainerComponent
1396 },
1397 {
1398 path: "profile/edit",
1399 component: ProfileEditContainerComponent
1400 }
1401 ]
1402 },
1403 {
1404 path: "admin/user",
1405 children: [
1406 // { path: "managment", component: SearchComponent },
1407 {
1408 path: ":Email",
1409 component: FeatureContainerComponent,
1410 children: [
1411 {
1412 path: "profile-edit",
1413 component: ProfileEditContainerComponent
1414 }
1415 ]
1416 }
1417 ]
1418 }
1419];
1420/** @type {?} */
1421const NgsUserRoutingModule = RouterModule.forChild(routes);
1422
1423/**
1424 * @fileoverview added by tsickle
1425 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1426 */
1427/** @enum {string} */
1428var NgsUserModuleOutlets = {
1429 ngs_user_profile_view: "ngs-user-profile-view",
1430};
1431
1432/**
1433 * @fileoverview added by tsickle
1434 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1435 */
1436class UserFacadeService {
1437 /**
1438 * @param {?} store
1439 * @param {?} configService
1440 */
1441 constructor(store, configService) {
1442 this.store = store;
1443 this.configService = configService;
1444 }
1445 /**
1446 * @return {?}
1447 */
1448 getDisplayName() {
1449 return this.store.select(getAccountInfo$2).let(this.configService.config$.getValue().mapUserDisplayName);
1450 // .pipe(filter(displayName => displayName !== undefined));
1451 }
1452 /**
1453 * @return {?}
1454 */
1455 getInfo() {
1456 return this.store.select(getAccountInfo$2);
1457 }
1458}
1459UserFacadeService.decorators = [
1460 { type: Injectable, args: [{
1461 providedIn: "root"
1462 },] }
1463];
1464/** @nocollapse */
1465UserFacadeService.ctorParameters = () => [
1466 { type: Store },
1467 { type: UserConfigurationService }
1468];
1469/** @nocollapse */ UserFacadeService.ngInjectableDef = defineInjectable({ factory: function UserFacadeService_Factory() { return new UserFacadeService(inject(Store), inject(UserConfigurationService)); }, token: UserFacadeService, providedIn: "root" });
1470
1471/**
1472 * @fileoverview added by tsickle
1473 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1474 */
1475
1476/**
1477 * @fileoverview added by tsickle
1478 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
1479 */
1480
1481export { UserModel, NgsUserModule, NgsUserRoutingModule, NgsUserModuleOutlets, UserService, UserFacadeService, getAccountInfo$2 as getAccountInfo, UserActionTypes, ChangePasswordContainerComponent as ɵr, reducer$1 as ɵw, ChangePasswordComponent as ɵj, getAccountInfo as ɵu, userReducer as ɵt, DashboardContainerComponent as ɵq, DashboardLinksComponent as ɵm, FeatureContainerComponent as ɵp, UserEffects as ɵbb, EditProfileEffects as ɵz, reducer$2 as ɵy, ProfileEditContainerComponent as ɵs, ProfileEditComponent as ɵk, ProfileContainerComponent as ɵl, ProfileViewEffects as ɵba, ProfileComponent as ɵi, reducer as ɵv, ResetPasswordRequestComponent as ɵo, reducer$3 as ɵx, SearchComponent as ɵh, UserConfigurationService as ɵn, MODULE_CONFIG_TOKEN as ɵa, RootNgsUserModule as ɵb, UserReducers as ɵd, selectFeatureState as ɵf, selectUserInformaionState as ɵg, routes as ɵc };
1482
1483//# sourceMappingURL=soushians-user.js.map
\No newline at end of file