@abp/ng.account 5.0.0 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/config/package.json +5 -5
  2. package/{esm2015/abp-ng.account.js → esm2020/abp-ng.account.mjs} +0 -0
  3. package/{esm2015/config/abp-ng.account-config.js → esm2020/config/abp-ng.account-config.mjs} +0 -0
  4. package/{esm2015/config/account-config.module.js → esm2020/config/account-config.module.mjs} +5 -5
  5. package/{esm2015/config/enums/index.js → esm2020/config/enums/index.mjs} +0 -0
  6. package/{esm2015/config/enums/route-names.js → esm2020/config/enums/route-names.mjs} +0 -0
  7. package/{esm2015/config/providers/index.js → esm2020/config/providers/index.mjs} +0 -0
  8. package/{esm2015/config/providers/route.provider.js → esm2020/config/providers/route.provider.mjs} +0 -0
  9. package/{esm2015/config/public-api.js → esm2020/config/public-api.mjs} +0 -0
  10. package/{esm2015/config/utils/factories.js → esm2020/config/utils/factories.mjs} +0 -0
  11. package/{esm2015/lib/account-routing.module.js → esm2020/lib/account-routing.module.mjs} +5 -5
  12. package/{esm2015/lib/account.module.js → esm2020/lib/account.module.mjs} +5 -5
  13. package/esm2020/lib/components/change-password/change-password.component.mjs +87 -0
  14. package/esm2020/lib/components/forgot-password/forgot-password.component.mjs +43 -0
  15. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +0 -0
  16. package/esm2020/lib/components/login/login.component.mjs +64 -0
  17. package/esm2020/lib/components/manage-profile/manage-profile.component.mjs +45 -0
  18. package/esm2020/lib/components/personal-settings/personal-settings.component.mjs +55 -0
  19. package/esm2020/lib/components/register/register.component.mjs +83 -0
  20. package/esm2020/lib/components/reset-password/reset-password.component.mjs +68 -0
  21. package/{esm2015/lib/enums/components.js → esm2020/lib/enums/components.mjs} +0 -0
  22. package/{esm2015/lib/enums/index.js → esm2020/lib/enums/index.mjs} +0 -0
  23. package/{esm2015/lib/guards/authentication-flow.guard.js → esm2020/lib/guards/authentication-flow.guard.mjs} +4 -4
  24. package/{esm2015/lib/guards/index.js → esm2020/lib/guards/index.mjs} +0 -0
  25. package/{esm2015/lib/models/account.js → esm2020/lib/models/account.mjs} +0 -0
  26. package/{esm2015/lib/models/config-options.js → esm2020/lib/models/config-options.mjs} +0 -0
  27. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
  28. package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
  29. package/{esm2015/lib/services/manage-profile.state.service.js → esm2020/lib/services/manage-profile.state.service.mjs} +4 -4
  30. package/{esm2015/lib/tokens/config-options.token.js → esm2020/lib/tokens/config-options.token.mjs} +0 -0
  31. package/{esm2015/lib/tokens/index.js → esm2020/lib/tokens/index.mjs} +0 -0
  32. package/{esm2015/lib/utils/auth-utils.js → esm2020/lib/utils/auth-utils.mjs} +0 -0
  33. package/esm2020/lib/utils/factory-utils.mjs +7 -0
  34. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  35. package/fesm2015/{abp-ng.account-config.js → abp-ng.account-config.mjs} +5 -5
  36. package/fesm2015/abp-ng.account-config.mjs.map +1 -0
  37. package/fesm2015/abp-ng.account.mjs +571 -0
  38. package/fesm2015/abp-ng.account.mjs.map +1 -0
  39. package/fesm2020/abp-ng.account-config.mjs +90 -0
  40. package/fesm2020/abp-ng.account-config.mjs.map +1 -0
  41. package/fesm2020/abp-ng.account.mjs +575 -0
  42. package/fesm2020/abp-ng.account.mjs.map +1 -0
  43. package/package.json +30 -9
  44. package/bundles/abp-ng.account-config.umd.js +0 -120
  45. package/bundles/abp-ng.account-config.umd.js.map +0 -1
  46. package/bundles/abp-ng.account.umd.js +0 -974
  47. package/bundles/abp-ng.account.umd.js.map +0 -1
  48. package/esm2015/lib/components/change-password/change-password.component.js +0 -90
  49. package/esm2015/lib/components/forgot-password/forgot-password.component.js +0 -46
  50. package/esm2015/lib/components/login/login.component.js +0 -68
  51. package/esm2015/lib/components/manage-profile/manage-profile.component.js +0 -50
  52. package/esm2015/lib/components/personal-settings/personal-settings.component.js +0 -59
  53. package/esm2015/lib/components/register/register.component.js +0 -87
  54. package/esm2015/lib/components/reset-password/reset-password.component.js +0 -71
  55. package/esm2015/lib/utils/factory-utils.js +0 -4
  56. package/fesm2015/abp-ng.account-config.js.map +0 -1
  57. package/fesm2015/abp-ng.account.js +0 -598
  58. package/fesm2015/abp-ng.account.js.map +0 -1
@@ -0,0 +1,571 @@
1
+ import * as i3 from '@abp/ng.core';
2
+ import { InternalStore, RouterOutletComponent, ReplaceableRouteContainerComponent, AuthGuard, LazyModuleFactory, CoreModule } from '@abp/ng.core';
3
+ import * as i2$1 from '@abp/ng.theme.shared';
4
+ import { getPasswordValidators, fadeIn, ThemeSharedModule } from '@abp/ng.theme.shared';
5
+ import * as i0 from '@angular/core';
6
+ import { Component, InjectionToken, Injectable, NgModule } from '@angular/core';
7
+ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
8
+ import * as i6$1 from '@ngx-validate/core';
9
+ import { comparePasswords, NgxValidateCoreModule } from '@ngx-validate/core';
10
+ import * as i3$1 from '@angular/router';
11
+ import { ActivatedRoute, RouterModule } from '@angular/router';
12
+ import * as i1 from '@angular/forms';
13
+ import { Validators, FormControl } from '@angular/forms';
14
+ import { finalize, catchError, switchMap } from 'rxjs/operators';
15
+ import * as i2 from '@abp/ng.account.core/proxy';
16
+ import * as i6 from '@angular/common';
17
+ import { throwError } from 'rxjs';
18
+ import { trigger, transition, useAnimation } from '@angular/animations';
19
+
20
+ class ForgotPasswordComponent {
21
+ constructor(fb, accountService) {
22
+ this.fb = fb;
23
+ this.accountService = accountService;
24
+ this.isEmailSent = false;
25
+ this.form = this.fb.group({
26
+ email: ['', [Validators.required, Validators.email]],
27
+ });
28
+ }
29
+ onSubmit() {
30
+ if (this.form.invalid)
31
+ return;
32
+ this.inProgress = true;
33
+ this.accountService
34
+ .sendPasswordResetCode({
35
+ email: this.form.get('email').value,
36
+ appName: 'Angular',
37
+ })
38
+ .pipe(finalize(() => (this.inProgress = false)))
39
+ .subscribe(() => {
40
+ this.isEmailSent = true;
41
+ });
42
+ }
43
+ }
44
+ ForgotPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ForgotPasswordComponent, deps: [{ token: i1.FormBuilder }, { token: i2.AccountService }], target: i0.ɵɵFactoryTarget.Component });
45
+ ForgotPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ForgotPasswordComponent, selector: "abp-forgot-password", ngImport: i0, template: "<h4>{{ 'AbpAccount::ForgotPassword' | abpLocalization }}</h4>\r\n\r\n<form\r\n *ngIf=\"!isEmailSent; else emailSentTemplate\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n>\r\n <p>{{ 'AbpAccount::SendPasswordResetLink_Information' | abpLocalization }}</p>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::EmailAddress' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input type=\"email\" id=\"input-email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <abp-button\r\n class=\"d-block\"\r\n buttonClass=\"mt-2 mb-3 btn btn-primary btn-block\"\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpAccount::Submit' | abpLocalization }}\r\n </abp-button>\r\n <a routerLink=\"/account/login\"\r\n ><i class=\"fa fa-long-arrow-left me-1\"></i>{{ 'AbpAccount::Login' | abpLocalization }}</a\r\n >\r\n</form>\r\n\r\n<ng-template #emailSentTemplate>\r\n <p>\r\n {{ 'AbpAccount::PasswordResetMailSentMessage' | abpLocalization }}\r\n </p>\r\n\r\n <a routerLink=\"/account/login\">\r\n <button class=\"d-block mt-2 mb-3 btn btn-primary btn-block\">\r\n <i class=\"fa fa-long-arrow-left me-1\"></i>\r\n {{ 'AbpAccount::BackToLogin' | abpLocalization }}\r\n </button>\r\n </a>\r\n</ng-template>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ForgotPasswordComponent, decorators: [{
47
+ type: Component,
48
+ args: [{ selector: 'abp-forgot-password', template: "<h4>{{ 'AbpAccount::ForgotPassword' | abpLocalization }}</h4>\r\n\r\n<form\r\n *ngIf=\"!isEmailSent; else emailSentTemplate\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n>\r\n <p>{{ 'AbpAccount::SendPasswordResetLink_Information' | abpLocalization }}</p>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::EmailAddress' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input type=\"email\" id=\"input-email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <abp-button\r\n class=\"d-block\"\r\n buttonClass=\"mt-2 mb-3 btn btn-primary btn-block\"\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpAccount::Submit' | abpLocalization }}\r\n </abp-button>\r\n <a routerLink=\"/account/login\"\r\n ><i class=\"fa fa-long-arrow-left me-1\"></i>{{ 'AbpAccount::Login' | abpLocalization }}</a\r\n >\r\n</form>\r\n\r\n<ng-template #emailSentTemplate>\r\n <p>\r\n {{ 'AbpAccount::PasswordResetMailSentMessage' | abpLocalization }}\r\n </p>\r\n\r\n <a routerLink=\"/account/login\">\r\n <button class=\"d-block mt-2 mb-3 btn btn-primary btn-block\">\r\n <i class=\"fa fa-long-arrow-left me-1\"></i>\r\n {{ 'AbpAccount::BackToLogin' | abpLocalization }}\r\n </button>\r\n </a>\r\n</ng-template>\r\n" }]
49
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.AccountService }]; } });
50
+
51
+ const ACCOUNT_CONFIG_OPTIONS = new InjectionToken('ACCOUNT_CONFIG_OPTIONS');
52
+
53
+ function getRedirectUrl(injector) {
54
+ const route = injector.get(ActivatedRoute);
55
+ const options = injector.get(ACCOUNT_CONFIG_OPTIONS);
56
+ return route.snapshot.queryParams.returnUrl || options.redirectUrl || '/';
57
+ }
58
+
59
+ const { maxLength: maxLength$2, required: required$3 } = Validators;
60
+ class LoginComponent {
61
+ constructor(injector, fb, toasterService, authService, configState) {
62
+ this.injector = injector;
63
+ this.fb = fb;
64
+ this.toasterService = toasterService;
65
+ this.authService = authService;
66
+ this.configState = configState;
67
+ this.isSelfRegistrationEnabled = true;
68
+ this.authWrapperKey = "Account.AuthWrapperComponent" /* AuthWrapper */;
69
+ }
70
+ ngOnInit() {
71
+ this.init();
72
+ this.buildForm();
73
+ }
74
+ init() {
75
+ this.isSelfRegistrationEnabled =
76
+ (this.configState.getSetting('Abp.Account.IsSelfRegistrationEnabled') || '').toLowerCase() !== 'false';
77
+ }
78
+ buildForm() {
79
+ this.form = this.fb.group({
80
+ username: ['', [required$3, maxLength$2(255)]],
81
+ password: ['', [required$3, maxLength$2(128)]],
82
+ rememberMe: [false],
83
+ });
84
+ }
85
+ onSubmit() {
86
+ if (this.form.invalid)
87
+ return;
88
+ this.inProgress = true;
89
+ const { username, password, rememberMe } = this.form.value;
90
+ const redirectUrl = getRedirectUrl(this.injector);
91
+ this.authService
92
+ .login({ username, password, rememberMe, redirectUrl })
93
+ .pipe(catchError(err => {
94
+ var _a, _b;
95
+ this.toasterService.error(((_a = err.error) === null || _a === void 0 ? void 0 : _a.error_description) ||
96
+ ((_b = err.error) === null || _b === void 0 ? void 0 : _b.error.message) ||
97
+ 'AbpAccount::DefaultErrorMessage', null, { life: 7000 });
98
+ return throwError(err);
99
+ }), finalize(() => (this.inProgress = false)))
100
+ .subscribe();
101
+ }
102
+ }
103
+ LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: LoginComponent, deps: [{ token: i0.Injector }, { token: i1.FormBuilder }, { token: i2$1.ToasterService }, { token: i3.AuthService }, { token: i3.ConfigStateService }], target: i0.ɵɵFactoryTarget.Component });
104
+ LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: LoginComponent, selector: "abp-login", ngImport: i0, template: "<h4>{{ 'AbpAccount::Login' | abpLocalization }}</h4>\r\n<strong *ngIf=\"isSelfRegistrationEnabled\">\r\n {{ 'AbpAccount::AreYouANewUser' | abpLocalization }}\r\n <a class=\"text-decoration-none\" routerLink=\"/account/register\" queryParamsHandling=\"preserve\">{{\r\n 'AbpAccount::Register' | abpLocalization\r\n }}</a>\r\n</strong>\r\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" validateOnSubmit class=\"mt-4\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"login-input-user-name-or-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::UserNameOrEmailAddress' | abpLocalization\r\n }}</label>\r\n <input\r\n class=\"form-control\"\r\n type=\"text\"\r\n id=\"login-input-user-name-or-email-address\"\r\n formControlName=\"username\"\r\n autocomplete=\"username\"\r\n autofocus\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"login-input-password\" class=\"form-label\">{{ 'AbpAccount::Password' | abpLocalization }}</label>\r\n <input\r\n class=\"form-control\"\r\n type=\"password\"\r\n id=\"login-input-password\"\r\n formControlName=\"password\"\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <div class=\"form-check\">\r\n <label class=\"form-check-label mb-2\" for=\"login-input-remember-me\">\r\n <input\r\n class=\"form-check-input\"\r\n type=\"checkbox\"\r\n id=\"login-input-remember-me\"\r\n formControlName=\"rememberMe\"\r\n />\r\n {{ 'AbpAccount::RememberMe' | abpLocalization }}\r\n </label>\r\n </div>\r\n </div>\r\n <div class=\"text-end col\">\r\n <a routerLink=\"/account/forgot-password\">{{\r\n 'AbpAccount::ForgotPassword' | abpLocalization\r\n }}</a>\r\n </div>\r\n </div>\r\n\r\n <abp-button\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n name=\"Action\"\r\n buttonClass=\"btn-block btn-lg mt-3 btn btn-primary\"\r\n >\r\n {{ 'AbpAccount::Login' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }], pipes: { "abpLocalization": i3.LocalizationPipe } });
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: LoginComponent, decorators: [{
106
+ type: Component,
107
+ args: [{ selector: 'abp-login', template: "<h4>{{ 'AbpAccount::Login' | abpLocalization }}</h4>\r\n<strong *ngIf=\"isSelfRegistrationEnabled\">\r\n {{ 'AbpAccount::AreYouANewUser' | abpLocalization }}\r\n <a class=\"text-decoration-none\" routerLink=\"/account/register\" queryParamsHandling=\"preserve\">{{\r\n 'AbpAccount::Register' | abpLocalization\r\n }}</a>\r\n</strong>\r\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" validateOnSubmit class=\"mt-4\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"login-input-user-name-or-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::UserNameOrEmailAddress' | abpLocalization\r\n }}</label>\r\n <input\r\n class=\"form-control\"\r\n type=\"text\"\r\n id=\"login-input-user-name-or-email-address\"\r\n formControlName=\"username\"\r\n autocomplete=\"username\"\r\n autofocus\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"login-input-password\" class=\"form-label\">{{ 'AbpAccount::Password' | abpLocalization }}</label>\r\n <input\r\n class=\"form-control\"\r\n type=\"password\"\r\n id=\"login-input-password\"\r\n formControlName=\"password\"\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <div class=\"form-check\">\r\n <label class=\"form-check-label mb-2\" for=\"login-input-remember-me\">\r\n <input\r\n class=\"form-check-input\"\r\n type=\"checkbox\"\r\n id=\"login-input-remember-me\"\r\n formControlName=\"rememberMe\"\r\n />\r\n {{ 'AbpAccount::RememberMe' | abpLocalization }}\r\n </label>\r\n </div>\r\n </div>\r\n <div class=\"text-end col\">\r\n <a routerLink=\"/account/forgot-password\">{{\r\n 'AbpAccount::ForgotPassword' | abpLocalization\r\n }}</a>\r\n </div>\r\n </div>\r\n\r\n <abp-button\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n name=\"Action\"\r\n buttonClass=\"btn-block btn-lg mt-3 btn btn-primary\"\r\n >\r\n {{ 'AbpAccount::Login' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n" }]
108
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.FormBuilder }, { type: i2$1.ToasterService }, { type: i3.AuthService }, { type: i3.ConfigStateService }]; } });
109
+
110
+ class ManageProfileStateService {
111
+ constructor() {
112
+ this.store = new InternalStore({});
113
+ }
114
+ get createOnUpdateStream() {
115
+ return this.store.sliceUpdate;
116
+ }
117
+ getProfile$() {
118
+ return this.store.sliceState(state => state.profile);
119
+ }
120
+ getProfile() {
121
+ return this.store.state.profile;
122
+ }
123
+ setProfile(profile) {
124
+ this.store.patch({ profile });
125
+ }
126
+ }
127
+ ManageProfileStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ManageProfileStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
128
+ ManageProfileStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ManageProfileStateService, providedIn: 'root' });
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ManageProfileStateService, decorators: [{
130
+ type: Injectable,
131
+ args: [{ providedIn: 'root' }]
132
+ }] });
133
+
134
+ const { required: required$2 } = Validators;
135
+ const PASSWORD_FIELDS$1 = ['newPassword', 'repeatNewPassword'];
136
+ class ChangePasswordComponent {
137
+ constructor(fb, injector, toasterService, profileService, manageProfileState) {
138
+ this.fb = fb;
139
+ this.injector = injector;
140
+ this.toasterService = toasterService;
141
+ this.profileService = profileService;
142
+ this.manageProfileState = manageProfileState;
143
+ this.mapErrorsFn = (errors, groupErrors, control) => {
144
+ if (PASSWORD_FIELDS$1.indexOf(String(control.name)) < 0)
145
+ return errors;
146
+ return errors.concat(groupErrors.filter(({ key }) => key === 'passwordMismatch'));
147
+ };
148
+ }
149
+ ngOnInit() {
150
+ var _a;
151
+ this.hideCurrentPassword = !((_a = this.manageProfileState.getProfile()) === null || _a === void 0 ? void 0 : _a.hasPassword);
152
+ const passwordValidations = getPasswordValidators(this.injector);
153
+ this.form = this.fb.group({
154
+ password: ['', required$2],
155
+ newPassword: [
156
+ '',
157
+ {
158
+ validators: [required$2, ...passwordValidations],
159
+ },
160
+ ],
161
+ repeatNewPassword: [
162
+ '',
163
+ {
164
+ validators: [required$2, ...passwordValidations],
165
+ },
166
+ ],
167
+ }, {
168
+ validators: [comparePasswords(PASSWORD_FIELDS$1)],
169
+ });
170
+ if (this.hideCurrentPassword)
171
+ this.form.removeControl('password');
172
+ }
173
+ onSubmit() {
174
+ if (this.form.invalid)
175
+ return;
176
+ this.inProgress = true;
177
+ this.profileService
178
+ .changePassword(Object.assign(Object.assign({}, (!this.hideCurrentPassword && { currentPassword: this.form.get('password').value })), { newPassword: this.form.get('newPassword').value }))
179
+ .pipe(finalize(() => (this.inProgress = false)))
180
+ .subscribe({
181
+ next: () => {
182
+ this.form.reset();
183
+ this.toasterService.success('AbpAccount::PasswordChangedMessage', '', {
184
+ life: 5000,
185
+ });
186
+ if (this.hideCurrentPassword) {
187
+ this.hideCurrentPassword = false;
188
+ this.form.addControl('password', new FormControl('', [required$2]));
189
+ }
190
+ },
191
+ error: err => {
192
+ var _a, _b;
193
+ this.toasterService.error(((_b = (_a = err.error) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.message) || 'AbpAccount::DefaultErrorMessage');
194
+ },
195
+ });
196
+ }
197
+ }
198
+ ChangePasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ChangePasswordComponent, deps: [{ token: i1.FormBuilder }, { token: i0.Injector }, { token: i2$1.ToasterService }, { token: i2.ProfileService }, { token: ManageProfileStateService }], target: i0.ɵɵFactoryTarget.Component });
199
+ ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ChangePasswordComponent, selector: "abp-change-password-form", exportAs: ["abpChangePasswordForm"], ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" [mapErrorsFn]=\"mapErrorsFn\" validateOnSubmit>\r\n <div *ngIf=\"!hideCurrentPassword\" class=\"mb-3 form-group\">\r\n <label for=\"current-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:CurrentPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"current-password\"\r\n class=\"form-control\"\r\n formControlName=\"password\"\r\n autofocus\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"new-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:NewPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"new-password\"\r\n class=\"form-control\"\r\n formControlName=\"newPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"confirm-new-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:NewPasswordConfirm' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"confirm-new-password\"\r\n class=\"form-control\"\r\n formControlName=\"repeatNewPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n <abp-button\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n buttonType=\"submit\"\r\n [loading]=\"inProgress\"\r\n [disabled]=\"form?.invalid\"\r\n >{{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ChangePasswordComponent, decorators: [{
201
+ type: Component,
202
+ args: [{ selector: 'abp-change-password-form', exportAs: 'abpChangePasswordForm', template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" [mapErrorsFn]=\"mapErrorsFn\" validateOnSubmit>\r\n <div *ngIf=\"!hideCurrentPassword\" class=\"mb-3 form-group\">\r\n <label for=\"current-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:CurrentPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"current-password\"\r\n class=\"form-control\"\r\n formControlName=\"password\"\r\n autofocus\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"new-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:NewPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"new-password\"\r\n class=\"form-control\"\r\n formControlName=\"newPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"confirm-new-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:NewPasswordConfirm' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"confirm-new-password\"\r\n class=\"form-control\"\r\n formControlName=\"repeatNewPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n <abp-button\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n buttonType=\"submit\"\r\n [loading]=\"inProgress\"\r\n [disabled]=\"form?.invalid\"\r\n >{{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n" }]
203
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.Injector }, { type: i2$1.ToasterService }, { type: i2.ProfileService }, { type: ManageProfileStateService }]; } });
204
+
205
+ const { maxLength: maxLength$1, required: required$1, email: email$1 } = Validators;
206
+ class PersonalSettingsComponent {
207
+ constructor(fb, toasterService, profileService, manageProfileState) {
208
+ this.fb = fb;
209
+ this.toasterService = toasterService;
210
+ this.profileService = profileService;
211
+ this.manageProfileState = manageProfileState;
212
+ }
213
+ ngOnInit() {
214
+ this.buildForm();
215
+ }
216
+ buildForm() {
217
+ const profile = this.manageProfileState.getProfile();
218
+ this.form = this.fb.group({
219
+ userName: [profile.userName, [required$1, maxLength$1(256)]],
220
+ email: [profile.email, [required$1, email$1, maxLength$1(256)]],
221
+ name: [profile.name || '', [maxLength$1(64)]],
222
+ surname: [profile.surname || '', [maxLength$1(64)]],
223
+ phoneNumber: [profile.phoneNumber || '', [maxLength$1(16)]],
224
+ });
225
+ }
226
+ submit() {
227
+ if (this.form.invalid)
228
+ return;
229
+ this.inProgress = true;
230
+ this.profileService
231
+ .update(this.form.value)
232
+ .pipe(finalize(() => (this.inProgress = false)))
233
+ .subscribe(profile => {
234
+ this.manageProfileState.setProfile(profile);
235
+ this.toasterService.success('AbpAccount::PersonalSettingsSaved', 'Success', { life: 5000 });
236
+ });
237
+ }
238
+ }
239
+ PersonalSettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: PersonalSettingsComponent, deps: [{ token: i1.FormBuilder }, { token: i2$1.ToasterService }, { token: i2.ProfileService }, { token: ManageProfileStateService }], target: i0.ɵɵFactoryTarget.Component });
240
+ PersonalSettingsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: PersonalSettingsComponent, selector: "abp-personal-settings-form", exportAs: ["abpPersonalSettingsForm"], ngImport: i0, template: "<form validateOnSubmit *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"username\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:UserName' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"text\"\r\n id=\"username\"\r\n class=\"form-control\"\r\n formControlName=\"userName\"\r\n autofocus\r\n (keydown.space)=\"$event.preventDefault()\"\r\n />\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col col-md-6\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"name\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Name' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"name\" class=\"form-control\" formControlName=\"name\" />\r\n </div>\r\n </div>\r\n <div class=\"col col-md-6\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"surname\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Surname' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"surname\" class=\"form-control\" formControlName=\"surname\" />\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"email-address\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Email' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input type=\"text\" id=\"email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"phone-number\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:PhoneNumber' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"phone-number\" class=\"form-control\" formControlName=\"phoneNumber\" />\r\n </div>\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n [loading]=\"inProgress\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: PersonalSettingsComponent, decorators: [{
242
+ type: Component,
243
+ args: [{ selector: 'abp-personal-settings-form', exportAs: 'abpPersonalSettingsForm', template: "<form validateOnSubmit *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"username\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:UserName' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"text\"\r\n id=\"username\"\r\n class=\"form-control\"\r\n formControlName=\"userName\"\r\n autofocus\r\n (keydown.space)=\"$event.preventDefault()\"\r\n />\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col col-md-6\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"name\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Name' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"name\" class=\"form-control\" formControlName=\"name\" />\r\n </div>\r\n </div>\r\n <div class=\"col col-md-6\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"surname\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Surname' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"surname\" class=\"form-control\" formControlName=\"surname\" />\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"email-address\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Email' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input type=\"text\" id=\"email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"phone-number\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:PhoneNumber' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"phone-number\" class=\"form-control\" formControlName=\"phoneNumber\" />\r\n </div>\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n [loading]=\"inProgress\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n" }]
244
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2$1.ToasterService }, { type: i2.ProfileService }, { type: ManageProfileStateService }]; } });
245
+
246
+ class ManageProfileComponent {
247
+ constructor(profileService, manageProfileState) {
248
+ this.profileService = profileService;
249
+ this.manageProfileState = manageProfileState;
250
+ this.selectedTab = 0;
251
+ this.changePasswordKey = "Account.ChangePasswordComponent" /* ChangePassword */;
252
+ this.personalSettingsKey = "Account.PersonalSettingsComponent" /* PersonalSettings */;
253
+ this.profile$ = this.manageProfileState.getProfile$();
254
+ }
255
+ ngOnInit() {
256
+ this.profileService.get().subscribe(profile => {
257
+ this.manageProfileState.setProfile(profile);
258
+ if (profile.isExternal) {
259
+ this.hideChangePasswordTab = true;
260
+ this.selectedTab = 1;
261
+ }
262
+ });
263
+ }
264
+ }
265
+ ManageProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ManageProfileComponent, deps: [{ token: i2.ProfileService }, { token: ManageProfileStateService }], target: i0.ɵɵFactoryTarget.Component });
266
+ ManageProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ManageProfileComponent, selector: "abp-manage-profile", ngImport: i0, template: "<div id=\"AbpContentToolbar\"></div>\r\n\r\n<div class=\"card border-0 shadow-sm min-h-400\" [abpLoading]=\"!(profile$ | async)?.userName\">\r\n <div class=\"card-body\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-3\">\r\n <ul class=\"nav flex-column nav-pills\" id=\"nav-tab\" role=\"tablist\">\r\n <li\r\n *ngIf=\"!hideChangePasswordTab && (profile$ | async)\"\r\n class=\"nav-item\"\r\n (click)=\"selectedTab = 0\"\r\n >\r\n <a\r\n class=\"nav-link\"\r\n [ngClass]=\"{ active: selectedTab === 0 }\"\r\n role=\"tab\"\r\n href=\"javascript:void(0)\"\r\n >{{ 'AbpUi::ChangePassword' | abpLocalization }}</a\r\n >\r\n </li>\r\n <li class=\"nav-item mb-2\" (click)=\"selectedTab = 1\">\r\n <a\r\n class=\"nav-link\"\r\n [ngClass]=\"{ active: selectedTab === 1 }\"\r\n role=\"tab\"\r\n href=\"javascript:void(0)\"\r\n >{{ 'AbpAccount::PersonalSettings' | abpLocalization }}</a\r\n >\r\n </li>\r\n </ul>\r\n </div>\r\n <div *ngIf=\"profile$ | async\" class=\"col-12 col-md-9\">\r\n <div class=\"tab-content\" *ngIf=\"selectedTab === 0\" [@fadeIn]>\r\n <div class=\"tab-pane active\" role=\"tabpanel\">\r\n <h4>\r\n {{ 'AbpIdentity::ChangePassword' | abpLocalization }}\r\n <hr />\r\n </h4>\r\n <abp-change-password-form\r\n *abpReplaceableTemplate=\"{\r\n componentKey: changePasswordKey\r\n }\"\r\n ></abp-change-password-form>\r\n </div>\r\n </div>\r\n <div class=\"tab-content\" *ngIf=\"selectedTab === 1\" [@fadeIn]>\r\n <div class=\"tab-pane active\" role=\"tabpanel\">\r\n <h4>\r\n {{ 'AbpIdentity::PersonalSettings' | abpLocalization }}\r\n <hr />\r\n </h4>\r\n <abp-personal-settings-form\r\n *abpReplaceableTemplate=\"{\r\n componentKey: personalSettingsKey\r\n }\"\r\n ></abp-personal-settings-form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".min-h-400{min-height:400px}\n"], components: [{ type: ChangePasswordComponent, selector: "abp-change-password-form", exportAs: ["abpChangePasswordForm"] }, { type: PersonalSettingsComponent, selector: "abp-personal-settings-form", exportAs: ["abpPersonalSettingsForm"] }], directives: [{ type: i2$1.LoadingDirective, selector: "[abpLoading]", inputs: ["abpLoading", "abpLoadingTargetElement", "abpLoadingDelay"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }], pipes: { "async": i6.AsyncPipe, "abpLocalization": i3.LocalizationPipe }, animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])] });
267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ManageProfileComponent, decorators: [{
268
+ type: Component,
269
+ args: [{ selector: 'abp-manage-profile', animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])], styles: [
270
+ `
271
+ .min-h-400 {
272
+ min-height: 400px;
273
+ }
274
+ `,
275
+ ], template: "<div id=\"AbpContentToolbar\"></div>\r\n\r\n<div class=\"card border-0 shadow-sm min-h-400\" [abpLoading]=\"!(profile$ | async)?.userName\">\r\n <div class=\"card-body\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-3\">\r\n <ul class=\"nav flex-column nav-pills\" id=\"nav-tab\" role=\"tablist\">\r\n <li\r\n *ngIf=\"!hideChangePasswordTab && (profile$ | async)\"\r\n class=\"nav-item\"\r\n (click)=\"selectedTab = 0\"\r\n >\r\n <a\r\n class=\"nav-link\"\r\n [ngClass]=\"{ active: selectedTab === 0 }\"\r\n role=\"tab\"\r\n href=\"javascript:void(0)\"\r\n >{{ 'AbpUi::ChangePassword' | abpLocalization }}</a\r\n >\r\n </li>\r\n <li class=\"nav-item mb-2\" (click)=\"selectedTab = 1\">\r\n <a\r\n class=\"nav-link\"\r\n [ngClass]=\"{ active: selectedTab === 1 }\"\r\n role=\"tab\"\r\n href=\"javascript:void(0)\"\r\n >{{ 'AbpAccount::PersonalSettings' | abpLocalization }}</a\r\n >\r\n </li>\r\n </ul>\r\n </div>\r\n <div *ngIf=\"profile$ | async\" class=\"col-12 col-md-9\">\r\n <div class=\"tab-content\" *ngIf=\"selectedTab === 0\" [@fadeIn]>\r\n <div class=\"tab-pane active\" role=\"tabpanel\">\r\n <h4>\r\n {{ 'AbpIdentity::ChangePassword' | abpLocalization }}\r\n <hr />\r\n </h4>\r\n <abp-change-password-form\r\n *abpReplaceableTemplate=\"{\r\n componentKey: changePasswordKey\r\n }\"\r\n ></abp-change-password-form>\r\n </div>\r\n </div>\r\n <div class=\"tab-content\" *ngIf=\"selectedTab === 1\" [@fadeIn]>\r\n <div class=\"tab-pane active\" role=\"tabpanel\">\r\n <h4>\r\n {{ 'AbpIdentity::PersonalSettings' | abpLocalization }}\r\n <hr />\r\n </h4>\r\n <abp-personal-settings-form\r\n *abpReplaceableTemplate=\"{\r\n componentKey: personalSettingsKey\r\n }\"\r\n ></abp-personal-settings-form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
276
+ }], ctorParameters: function () { return [{ type: i2.ProfileService }, { type: ManageProfileStateService }]; } });
277
+
278
+ const { maxLength, required, email } = Validators;
279
+ class RegisterComponent {
280
+ constructor(fb, accountService, configState, toasterService, authService, injector) {
281
+ this.fb = fb;
282
+ this.accountService = accountService;
283
+ this.configState = configState;
284
+ this.toasterService = toasterService;
285
+ this.authService = authService;
286
+ this.injector = injector;
287
+ this.isSelfRegistrationEnabled = true;
288
+ this.authWrapperKey = "Account.AuthWrapperComponent" /* AuthWrapper */;
289
+ }
290
+ ngOnInit() {
291
+ this.init();
292
+ this.buildForm();
293
+ }
294
+ init() {
295
+ this.isSelfRegistrationEnabled =
296
+ (this.configState.getSetting('Abp.Account.IsSelfRegistrationEnabled') || '').toLowerCase() !==
297
+ 'false';
298
+ if (!this.isSelfRegistrationEnabled) {
299
+ this.toasterService.warn({
300
+ key: 'AbpAccount::SelfRegistrationDisabledMessage',
301
+ defaultValue: 'Self registration is disabled.',
302
+ }, null, { life: 10000 });
303
+ return;
304
+ }
305
+ }
306
+ buildForm() {
307
+ this.form = this.fb.group({
308
+ username: ['', [required, maxLength(255)]],
309
+ password: ['', [required, ...getPasswordValidators(this.injector)]],
310
+ email: ['', [required, email]],
311
+ });
312
+ }
313
+ onSubmit() {
314
+ if (this.form.invalid)
315
+ return;
316
+ this.inProgress = true;
317
+ const newUser = {
318
+ userName: this.form.get('username').value,
319
+ password: this.form.get('password').value,
320
+ emailAddress: this.form.get('email').value,
321
+ appName: 'Angular',
322
+ };
323
+ this.accountService
324
+ .register(newUser)
325
+ .pipe(switchMap(() => this.authService.login({
326
+ username: newUser.userName,
327
+ password: newUser.password,
328
+ redirectUrl: getRedirectUrl(this.injector),
329
+ })), catchError(err => {
330
+ var _a, _b;
331
+ this.toasterService.error(((_a = err.error) === null || _a === void 0 ? void 0 : _a.error_description) ||
332
+ ((_b = err.error) === null || _b === void 0 ? void 0 : _b.error.message) ||
333
+ 'AbpAccount::DefaultErrorMessage', null, { life: 7000 });
334
+ return throwError(err);
335
+ }), finalize(() => (this.inProgress = false)))
336
+ .subscribe();
337
+ }
338
+ }
339
+ RegisterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: RegisterComponent, deps: [{ token: i1.FormBuilder }, { token: i2.AccountService }, { token: i3.ConfigStateService }, { token: i2$1.ToasterService }, { token: i3.AuthService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
340
+ RegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: RegisterComponent, selector: "abp-register", ngImport: i0, template: "<h4>{{ 'AbpAccount::Register' | abpLocalization }}</h4>\r\n<strong>\r\n {{ 'AbpAccount::AlreadyRegistered' | abpLocalization }}\r\n <a class=\"text-decoration-none\" routerLink=\"/account/login\">{{\r\n 'AbpAccount::Login' | abpLocalization\r\n }}</a>\r\n</strong>\r\n<form\r\n *ngIf=\"isSelfRegistrationEnabled\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n class=\"mt-4\"\r\n>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-user-name\" class=\"form-label\">{{\r\n 'AbpAccount::UserName' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n autofocus\r\n type=\"text\"\r\n id=\"input-user-name\"\r\n class=\"form-control\"\r\n formControlName=\"username\"\r\n autocomplete=\"username\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::EmailAddress' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input type=\"email\" id=\"input-email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-password\" class=\"form-label\">{{\r\n 'AbpAccount::Password' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"input-password\"\r\n class=\"form-control\"\r\n formControlName=\"password\"\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n <abp-button\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n name=\"Action\"\r\n buttonClass=\"btn-block btn-lg mt-3 btn btn-primary\"\r\n >\r\n {{ 'AbpAccount::Register' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i3$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: RegisterComponent, decorators: [{
342
+ type: Component,
343
+ args: [{ selector: 'abp-register', template: "<h4>{{ 'AbpAccount::Register' | abpLocalization }}</h4>\r\n<strong>\r\n {{ 'AbpAccount::AlreadyRegistered' | abpLocalization }}\r\n <a class=\"text-decoration-none\" routerLink=\"/account/login\">{{\r\n 'AbpAccount::Login' | abpLocalization\r\n }}</a>\r\n</strong>\r\n<form\r\n *ngIf=\"isSelfRegistrationEnabled\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n class=\"mt-4\"\r\n>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-user-name\" class=\"form-label\">{{\r\n 'AbpAccount::UserName' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n autofocus\r\n type=\"text\"\r\n id=\"input-user-name\"\r\n class=\"form-control\"\r\n formControlName=\"username\"\r\n autocomplete=\"username\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::EmailAddress' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input type=\"email\" id=\"input-email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-password\" class=\"form-label\">{{\r\n 'AbpAccount::Password' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"input-password\"\r\n class=\"form-control\"\r\n formControlName=\"password\"\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n <abp-button\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n name=\"Action\"\r\n buttonClass=\"btn-block btn-lg mt-3 btn btn-primary\"\r\n >\r\n {{ 'AbpAccount::Register' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n" }]
344
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.AccountService }, { type: i3.ConfigStateService }, { type: i2$1.ToasterService }, { type: i3.AuthService }, { type: i0.Injector }]; } });
345
+
346
+ const PASSWORD_FIELDS = ['password', 'confirmPassword'];
347
+ class ResetPasswordComponent {
348
+ constructor(fb, accountService, route, router, injector) {
349
+ this.fb = fb;
350
+ this.accountService = accountService;
351
+ this.route = route;
352
+ this.router = router;
353
+ this.injector = injector;
354
+ this.inProgress = false;
355
+ this.isPasswordReset = false;
356
+ this.mapErrorsFn = (errors, groupErrors, control) => {
357
+ if (PASSWORD_FIELDS.indexOf(String(control.name)) < 0)
358
+ return errors;
359
+ return errors.concat(groupErrors.filter(({ key }) => key === 'passwordMismatch'));
360
+ };
361
+ }
362
+ ngOnInit() {
363
+ this.route.queryParams.subscribe(({ userId, resetToken }) => {
364
+ if (!userId || !resetToken)
365
+ this.router.navigateByUrl('/account/login');
366
+ this.form = this.fb.group({
367
+ userId: [userId, [Validators.required]],
368
+ resetToken: [resetToken, [Validators.required]],
369
+ password: ['', [Validators.required, ...getPasswordValidators(this.injector)]],
370
+ confirmPassword: ['', [Validators.required, ...getPasswordValidators(this.injector)]],
371
+ }, {
372
+ validators: [comparePasswords(PASSWORD_FIELDS)],
373
+ });
374
+ });
375
+ }
376
+ onSubmit() {
377
+ if (this.form.invalid || this.inProgress)
378
+ return;
379
+ this.inProgress = true;
380
+ this.accountService
381
+ .resetPassword({
382
+ userId: this.form.get('userId').value,
383
+ resetToken: this.form.get('resetToken').value,
384
+ password: this.form.get('password').value,
385
+ })
386
+ .pipe(finalize(() => (this.inProgress = false)))
387
+ .subscribe(() => {
388
+ this.isPasswordReset = true;
389
+ });
390
+ }
391
+ }
392
+ ResetPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ResetPasswordComponent, deps: [{ token: i1.FormBuilder }, { token: i2.AccountService }, { token: i3$1.ActivatedRoute }, { token: i3$1.Router }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
393
+ ResetPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ResetPasswordComponent, selector: "abp-reset-password", ngImport: i0, template: "<h4>{{ 'AbpAccount::ResetPassword' | abpLocalization }}</h4>\r\n\r\n<form\r\n *ngIf=\"!isPasswordReset; else passwordResetTemplate\"\r\n [formGroup]=\"form\"\r\n [mapErrorsFn]=\"mapErrorsFn\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n>\r\n <p>{{ 'AbpAccount::ResetPassword_Information' | abpLocalization }}</p>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-password\" class=\"form-label\">{{\r\n 'AbpAccount::Password' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input type=\"password\" id=\"input-password\" class=\"form-control\" formControlName=\"password\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-confirm-password\" class=\"form-label\">{{\r\n 'AbpAccount::ConfirmPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input\r\n type=\"password\"\r\n id=\"input-confirm-password\"\r\n class=\"form-control\"\r\n formControlName=\"confirmPassword\"\r\n />\r\n </div>\r\n <button class=\"me-2 btn btn-secondary\" type=\"button\" routerLink=\"/account/login\">\r\n {{ 'AbpAccount::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button\r\n buttonType=\"submit\"\r\n buttonClass=\"me-2 btn btn-primary\"\r\n [loading]=\"inProgress\"\r\n (click)=\"onSubmit()\"\r\n >\r\n {{ 'AbpAccount::Submit' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n\r\n<ng-template #passwordResetTemplate>\r\n <p>\r\n {{ 'AbpAccount::YourPasswordIsSuccessfullyReset' | abpLocalization }}\r\n </p>\r\n\r\n <a routerLink=\"/account/login\">\r\n <button class=\"d-block mt-2 mb-3 btn btn-primary\">\r\n {{ 'AbpAccount::BackToLogin' | abpLocalization }}\r\n </button>\r\n </a>\r\n</ng-template>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3$1.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i3$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ResetPasswordComponent, decorators: [{
395
+ type: Component,
396
+ args: [{ selector: 'abp-reset-password', template: "<h4>{{ 'AbpAccount::ResetPassword' | abpLocalization }}</h4>\r\n\r\n<form\r\n *ngIf=\"!isPasswordReset; else passwordResetTemplate\"\r\n [formGroup]=\"form\"\r\n [mapErrorsFn]=\"mapErrorsFn\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n>\r\n <p>{{ 'AbpAccount::ResetPassword_Information' | abpLocalization }}</p>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-password\" class=\"form-label\">{{\r\n 'AbpAccount::Password' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input type=\"password\" id=\"input-password\" class=\"form-control\" formControlName=\"password\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-confirm-password\" class=\"form-label\">{{\r\n 'AbpAccount::ConfirmPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input\r\n type=\"password\"\r\n id=\"input-confirm-password\"\r\n class=\"form-control\"\r\n formControlName=\"confirmPassword\"\r\n />\r\n </div>\r\n <button class=\"me-2 btn btn-secondary\" type=\"button\" routerLink=\"/account/login\">\r\n {{ 'AbpAccount::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button\r\n buttonType=\"submit\"\r\n buttonClass=\"me-2 btn btn-primary\"\r\n [loading]=\"inProgress\"\r\n (click)=\"onSubmit()\"\r\n >\r\n {{ 'AbpAccount::Submit' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n\r\n<ng-template #passwordResetTemplate>\r\n <p>\r\n {{ 'AbpAccount::YourPasswordIsSuccessfullyReset' | abpLocalization }}\r\n </p>\r\n\r\n <a routerLink=\"/account/login\">\r\n <button class=\"d-block mt-2 mb-3 btn btn-primary\">\r\n {{ 'AbpAccount::BackToLogin' | abpLocalization }}\r\n </button>\r\n </a>\r\n</ng-template>\r\n" }]
397
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.AccountService }, { type: i3$1.ActivatedRoute }, { type: i3$1.Router }, { type: i0.Injector }]; } });
398
+
399
+ class AuthenticationFlowGuard {
400
+ constructor(authService) {
401
+ this.authService = authService;
402
+ }
403
+ canActivate() {
404
+ if (this.authService.isInternalAuth)
405
+ return true;
406
+ this.authService.navigateToLogin();
407
+ return false;
408
+ }
409
+ }
410
+ AuthenticationFlowGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AuthenticationFlowGuard, deps: [{ token: i3.AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
411
+ AuthenticationFlowGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AuthenticationFlowGuard });
412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AuthenticationFlowGuard, decorators: [{
413
+ type: Injectable
414
+ }], ctorParameters: function () { return [{ type: i3.AuthService }]; } });
415
+
416
+ const routes = [
417
+ { path: '', pathMatch: 'full', redirectTo: 'login' },
418
+ {
419
+ path: '',
420
+ component: RouterOutletComponent,
421
+ children: [
422
+ {
423
+ path: 'login',
424
+ component: ReplaceableRouteContainerComponent,
425
+ canActivate: [AuthenticationFlowGuard],
426
+ data: {
427
+ replaceableComponent: {
428
+ key: "Account.LoginComponent" /* Login */,
429
+ defaultComponent: LoginComponent,
430
+ },
431
+ },
432
+ },
433
+ {
434
+ path: 'register',
435
+ component: ReplaceableRouteContainerComponent,
436
+ canActivate: [AuthenticationFlowGuard],
437
+ data: {
438
+ replaceableComponent: {
439
+ key: "Account.RegisterComponent" /* Register */,
440
+ defaultComponent: RegisterComponent,
441
+ },
442
+ },
443
+ },
444
+ {
445
+ path: 'forgot-password',
446
+ component: ReplaceableRouteContainerComponent,
447
+ canActivate: [AuthenticationFlowGuard],
448
+ data: {
449
+ replaceableComponent: {
450
+ key: "Account.ForgotPasswordComponent" /* ForgotPassword */,
451
+ defaultComponent: ForgotPasswordComponent,
452
+ },
453
+ },
454
+ },
455
+ {
456
+ path: 'reset-password',
457
+ component: ReplaceableRouteContainerComponent,
458
+ canActivate: [],
459
+ data: {
460
+ tenantBoxVisible: false,
461
+ replaceableComponent: {
462
+ key: "Account.ResetPasswordComponent" /* ResetPassword */,
463
+ defaultComponent: ResetPasswordComponent,
464
+ },
465
+ },
466
+ },
467
+ {
468
+ path: 'manage',
469
+ component: ReplaceableRouteContainerComponent,
470
+ canActivate: [AuthGuard],
471
+ data: {
472
+ replaceableComponent: {
473
+ key: "Account.ManageProfileComponent" /* ManageProfile */,
474
+ defaultComponent: ManageProfileComponent,
475
+ },
476
+ },
477
+ },
478
+ ],
479
+ },
480
+ ];
481
+ class AccountRoutingModule {
482
+ }
483
+ AccountRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AccountRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
484
+ AccountRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AccountRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] });
485
+ AccountRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AccountRoutingModule, imports: [[RouterModule.forChild(routes)], RouterModule] });
486
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AccountRoutingModule, decorators: [{
487
+ type: NgModule,
488
+ args: [{
489
+ imports: [RouterModule.forChild(routes)],
490
+ exports: [RouterModule],
491
+ }]
492
+ }] });
493
+
494
+ function accountConfigOptionsFactory(options) {
495
+ return Object.assign({ redirectUrl: '/' }, options);
496
+ }
497
+
498
+ const declarations = [
499
+ LoginComponent,
500
+ RegisterComponent,
501
+ ChangePasswordComponent,
502
+ ManageProfileComponent,
503
+ PersonalSettingsComponent,
504
+ ForgotPasswordComponent,
505
+ ResetPasswordComponent,
506
+ ];
507
+ class AccountModule {
508
+ static forChild(options = {}) {
509
+ return {
510
+ ngModule: AccountModule,
511
+ providers: [
512
+ AuthenticationFlowGuard,
513
+ { provide: ACCOUNT_CONFIG_OPTIONS, useValue: options },
514
+ {
515
+ provide: 'ACCOUNT_OPTIONS',
516
+ useFactory: accountConfigOptionsFactory,
517
+ deps: [ACCOUNT_CONFIG_OPTIONS],
518
+ },
519
+ ],
520
+ };
521
+ }
522
+ static forLazy(options = {}) {
523
+ return new LazyModuleFactory(AccountModule.forChild(options));
524
+ }
525
+ }
526
+ AccountModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AccountModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
527
+ AccountModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AccountModule, declarations: [LoginComponent,
528
+ RegisterComponent,
529
+ ChangePasswordComponent,
530
+ ManageProfileComponent,
531
+ PersonalSettingsComponent,
532
+ ForgotPasswordComponent,
533
+ ResetPasswordComponent], imports: [CoreModule,
534
+ AccountRoutingModule,
535
+ ThemeSharedModule,
536
+ NgbDropdownModule,
537
+ NgxValidateCoreModule], exports: [LoginComponent,
538
+ RegisterComponent,
539
+ ChangePasswordComponent,
540
+ ManageProfileComponent,
541
+ PersonalSettingsComponent,
542
+ ForgotPasswordComponent,
543
+ ResetPasswordComponent] });
544
+ AccountModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AccountModule, imports: [[
545
+ CoreModule,
546
+ AccountRoutingModule,
547
+ ThemeSharedModule,
548
+ NgbDropdownModule,
549
+ NgxValidateCoreModule,
550
+ ]] });
551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: AccountModule, decorators: [{
552
+ type: NgModule,
553
+ args: [{
554
+ declarations: [...declarations],
555
+ imports: [
556
+ CoreModule,
557
+ AccountRoutingModule,
558
+ ThemeSharedModule,
559
+ NgbDropdownModule,
560
+ NgxValidateCoreModule,
561
+ ],
562
+ exports: [...declarations],
563
+ }]
564
+ }] });
565
+
566
+ /**
567
+ * Generated bundle index. Do not edit.
568
+ */
569
+
570
+ export { ACCOUNT_CONFIG_OPTIONS, AccountModule, AuthenticationFlowGuard, ChangePasswordComponent, ForgotPasswordComponent, LoginComponent, ManageProfileComponent, ManageProfileStateService, PersonalSettingsComponent, RegisterComponent, ResetPasswordComponent };
571
+ //# sourceMappingURL=abp-ng.account.mjs.map