@rxap/authentication 16.0.0-dev.2 → 16.0.0-dev.21

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 (53) hide show
  1. package/CHANGELOG.md +380 -0
  2. package/LICENSE +621 -21
  3. package/LICENSE.md +621 -0
  4. package/README.md +8 -22
  5. package/esm2022/index.mjs +6 -4
  6. package/esm2022/lib/authentication-routing.service.mjs +7 -8
  7. package/esm2022/lib/authentication.guard.mjs +7 -8
  8. package/esm2022/lib/authentication.service.mjs +12 -61
  9. package/esm2022/lib/bearer-token.interceptor.mjs +27 -0
  10. package/esm2022/lib/register.service.mjs +6 -6
  11. package/esm2022/lib/sign-out.directive.mjs +7 -8
  12. package/esm2022/lib/tokens.mjs +17 -2
  13. package/esm2022/rxap-authentication.mjs +1 -1
  14. package/fesm2022/rxap-authentication.mjs +102 -121
  15. package/fesm2022/rxap-authentication.mjs.map +1 -1
  16. package/index.d.ts +3 -3
  17. package/lib/authentication.guard.d.ts +1 -1
  18. package/lib/authentication.service.d.ts +3 -10
  19. package/lib/bearer-token.interceptor.d.ts +3 -0
  20. package/lib/tokens.d.ts +9 -1
  21. package/package.json +52 -62
  22. package/theme.css +1 -0
  23. package/collection.json +0 -10
  24. package/components/README.md +0 -3
  25. package/components/index.d.ts +0 -5
  26. package/components/lib/authentication-container/authentication-container.component.d.ts +0 -7
  27. package/components/lib/fade-animation.d.ts +0 -1
  28. package/components/lib/loading/loading.component.d.ts +0 -15
  29. package/components/lib/login/login.component.d.ts +0 -13
  30. package/components/lib/login/login.form.d.ts +0 -43
  31. package/components/lib/reset-password/reset-password.component.d.ts +0 -5
  32. package/components/lib/reset-password/reset-password.form.d.ts +0 -35
  33. package/components/lib/routes.d.ts +0 -2
  34. package/components/public_api.d.ts +0 -8
  35. package/esm2022/components/lib/authentication-container/authentication-container.component.mjs +0 -39
  36. package/esm2022/components/lib/fade-animation.mjs +0 -14
  37. package/esm2022/components/lib/loading/loading.component.mjs +0 -40
  38. package/esm2022/components/lib/login/login.component.mjs +0 -113
  39. package/esm2022/components/lib/login/login.form.mjs +0 -117
  40. package/esm2022/components/lib/reset-password/reset-password.component.mjs +0 -61
  41. package/esm2022/components/lib/reset-password/reset-password.form.mjs +0 -116
  42. package/esm2022/components/lib/routes.mjs +0 -32
  43. package/esm2022/components/public_api.mjs +0 -9
  44. package/esm2022/components/rxap-authentication-components.mjs +0 -5
  45. package/esm2022/lib/user.service.mjs +0 -16
  46. package/fesm2022/rxap-authentication-components.mjs +0 -472
  47. package/fesm2022/rxap-authentication-components.mjs.map +0 -1
  48. package/lib/user.service.d.ts +0 -16
  49. package/migration.json +0 -4
  50. package/src/schematics/ng-add/index.d.ts +0 -2
  51. package/src/schematics/ng-add/index.js +0 -8
  52. package/src/schematics/ng-add/index.js.map +0 -1
  53. package/src/schematics/ng-add/schema.json +0 -7
@@ -1,472 +0,0 @@
1
- import { __decorate, __metadata } from 'tslib';
2
- import * as i0 from '@angular/core';
3
- import { Injectable, Inject, INJECTOR, Component, ChangeDetectionStrategy } from '@angular/core';
4
- import * as i2 from '@rxap/authentication';
5
- import { RxapAuthenticationService, RxapAuthenticationGuard } from '@rxap/authentication';
6
- import { UseFormControl, RxapFormControl, RxapForm, RXAP_FORM_DEFINITION_BUILDER, RxapFormBuilder, RXAP_FORM_DEFINITION, RXAP_FORM_SUBMIT_METHOD, RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, FormDirective, FormControlErrorDirective, FormControlMarkDirtyDirective, FormSubmitFailedDirective, FormSubmittingDirective, ControlValidator, ControlSetValue } from '@rxap/forms';
7
- import * as i1$2 from '@angular/forms';
8
- import { Validators, ReactiveFormsModule } from '@angular/forms';
9
- import * as i1 from '@rxap/config';
10
- import { ConfigService } from '@rxap/config';
11
- import * as i1$1 from '@angular/router';
12
- import { Router, RouterOutlet, ActivatedRoute } from '@angular/router';
13
- import { ErrorStateMatcher, ShowOnDirtyErrorStateMatcher } from '@angular/material/core';
14
- import { trigger, state, style, transition, animate } from '@angular/animations';
15
- import * as i12 from '@angular/material/snack-bar';
16
- import { MatSnackBar } from '@angular/material/snack-bar';
17
- import { ToggleSubject } from '@rxap/utilities/rxjs';
18
- import * as i10 from '@angular/material/progress-bar';
19
- import { MatProgressBarModule } from '@angular/material/progress-bar';
20
- import * as i9 from '@angular/material/progress-spinner';
21
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
22
- import * as i8 from '@angular/material/tooltip';
23
- import { MatTooltipModule } from '@angular/material/tooltip';
24
- import * as i7 from '@angular/material/checkbox';
25
- import { MatCheckboxModule } from '@angular/material/checkbox';
26
- import * as i6 from '@angular/material/button';
27
- import { MatButtonModule } from '@angular/material/button';
28
- import { NgIf, AsyncPipe } from '@angular/common';
29
- import * as i5 from '@angular/material/input';
30
- import { MatInputModule } from '@angular/material/input';
31
- import * as i4 from '@angular/material/form-field';
32
- import { MatFormFieldModule } from '@angular/material/form-field';
33
- import * as i3 from '@angular/material/icon';
34
- import { MatIconModule } from '@angular/material/icon';
35
- import * as i2$1 from '@angular/flex-layout/flex';
36
- import { FlexModule } from '@angular/flex-layout/flex';
37
- import { take, map, switchMap, tap, filter } from 'rxjs/operators';
38
-
39
- let LoginForm = class LoginForm {
40
- constructor(config) {
41
- this.config = config;
42
- this.loading = true;
43
- this.loginFailed = false;
44
- }
45
- rxapOnInit() {
46
- const email = this.config.get('authentication.default.email');
47
- if (email) {
48
- this.email.setValue(email);
49
- }
50
- const password = this.config.get('authentication.default.password');
51
- if (password) {
52
- this.password.setValue(password);
53
- }
54
- }
55
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginForm, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
56
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginForm }); }
57
- };
58
- __decorate([
59
- UseFormControl({
60
- validators: [Validators.required, Validators.email],
61
- }),
62
- __metadata("design:type", RxapFormControl)
63
- ], LoginForm.prototype, "email", void 0);
64
- __decorate([
65
- UseFormControl({
66
- validators: [Validators.required],
67
- }),
68
- __metadata("design:type", RxapFormControl)
69
- ], LoginForm.prototype, "password", void 0);
70
- __decorate([
71
- UseFormControl({
72
- state: true,
73
- }),
74
- __metadata("design:type", RxapFormControl)
75
- ], LoginForm.prototype, "remember", void 0);
76
- LoginForm = __decorate([
77
- RxapForm({
78
- id: 'rxap-login',
79
- providers: [
80
- {
81
- provide: ConfigService,
82
- useExisting: ConfigService,
83
- },
84
- ],
85
- }),
86
- __metadata("design:paramtypes", [ConfigService])
87
- ], LoginForm);
88
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginForm, decorators: [{
89
- type: Injectable
90
- }], ctorParameters: function () { return [{ type: i1.ConfigService }]; }, propDecorators: { email: [], password: [], remember: [] } });
91
- class LoginFormSubmitMethod {
92
- constructor(authentication) {
93
- this.authentication = authentication;
94
- }
95
- call(value) {
96
- return this.authentication.signInWithEmailAndPassword(value.email, value.password, value.remember);
97
- }
98
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginFormSubmitMethod, deps: [{ token: i2.RxapAuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
99
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginFormSubmitMethod }); }
100
- }
101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginFormSubmitMethod, decorators: [{
102
- type: Injectable
103
- }], ctorParameters: function () { return [{ type: i2.RxapAuthenticationService }]; } });
104
- class LoginFormSubmitSuccessful {
105
- constructor(router) {
106
- this.router = router;
107
- }
108
- call() {
109
- return this.router.navigate(['/']);
110
- }
111
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginFormSubmitSuccessful, deps: [{ token: Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
112
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginFormSubmitSuccessful }); }
113
- }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginFormSubmitSuccessful, decorators: [{
115
- type: Injectable
116
- }], ctorParameters: function () { return [{ type: i1$1.Router, decorators: [{
117
- type: Inject,
118
- args: [Router]
119
- }] }]; } });
120
- const LoginFormProviders = [
121
- LoginForm,
122
- {
123
- provide: RXAP_FORM_DEFINITION_BUILDER,
124
- useFactory: (injector) => new RxapFormBuilder(LoginForm, injector),
125
- deps: [INJECTOR],
126
- },
127
- {
128
- provide: RXAP_FORM_DEFINITION,
129
- useFactory: (builder) => builder.build(),
130
- deps: [RXAP_FORM_DEFINITION_BUILDER],
131
- },
132
- {
133
- provide: RXAP_FORM_SUBMIT_METHOD,
134
- useClass: LoginFormSubmitMethod,
135
- },
136
- {
137
- provide: RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD,
138
- useClass: LoginFormSubmitSuccessful,
139
- },
140
- ];
141
-
142
- // the fade-in/fade-out animation.
143
- const fadeAnimation = trigger('fadeAnimation', [
144
- // the "in" style determines the "resting" state of the element when it is visible.
145
- state('in', style({ opacity: 1 })),
146
- // fade in when created. this could also be written as transition('void => *')
147
- transition(':enter', [
148
- style({ opacity: 0 }),
149
- animate(300)
150
- ]),
151
- // fade out when destroyed. this could also be written as transition('void => *')
152
- transition(':leave', animate(300, style({ opacity: 0 })))
153
- ]);
154
-
155
- class LoginComponent {
156
- constructor(authentication, snackBar) {
157
- this.authentication = authentication;
158
- this.snackBar = snackBar;
159
- this.requestingPasswordReset$ = new ToggleSubject();
160
- }
161
- async requestPasswordReset(email) {
162
- this.requestingPasswordReset$.enable();
163
- try {
164
- const result = await this.authentication.requestPasswordReset(email);
165
- if (!result) {
166
- this.snackBar.open('The password reset request result is falsy', undefined, {
167
- duration: 5000,
168
- panelClass: 'error'
169
- });
170
- }
171
- else {
172
- this.snackBar.open('The password reset request was successful', undefined, {
173
- duration: 3000
174
- });
175
- }
176
- }
177
- catch (e) {
178
- this.snackBar.open(e.message, undefined, {
179
- duration: 3000,
180
- panelClass: 'error'
181
- });
182
- }
183
- finally {
184
- this.requestingPasswordReset$.disable();
185
- }
186
- }
187
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginComponent, deps: [{ token: RxapAuthenticationService }, { token: MatSnackBar }], target: i0.ɵɵFactoryTarget.Component }); }
188
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: LoginComponent, isStandalone: true, selector: "rxap-login", providers: [
189
- LoginFormProviders,
190
- {
191
- provide: ErrorStateMatcher,
192
- useClass: ShowOnDirtyErrorStateMatcher
193
- }
194
- ], ngImport: i0, template: "<form rxapForm class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" #form=\"rxapForm\" fxLayoutGap=\"32px\" [@fadeAnimation]=\"'in'\"\n novalidate>\n\n <div class=\"header\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFlex=\"nogrow\">\n\n <mat-icon fxFlex=\"nogrow\" color=\"primary\" class=\"avatar-icon\">account_circle</mat-icon>\n\n </div>\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\">\n\n <mat-form-field class=\"email-input\">\n <mat-icon matPrefix inline>email</mat-icon>\n <mat-label i18n>Email</mat-label>\n <input matInput\n i18n-placeholder\n placeholder=\"Enter your email address\"\n type=\"email\"\n fxFlex=\"nogrow\"\n formControlName=\"email\">\n <mat-error *rxapFormControlError=\"let error from 'email'; if: 'required'\">\n Email is <strong>required</strong>\n </mat-error>\n <mat-error *rxapFormControlError=\"let error from 'email'; if: 'email'\">\n Please enter a valid email address\n </mat-error>\n </mat-form-field>\n\n <mat-form-field class=\"password-input\">\n <mat-icon matPrefix inline>vpn_key</mat-icon>\n <mat-label i18n>Password</mat-label>\n <input matInput\n type=\"password\"\n i18n-placeholder\n placeholder=\"Enter your password\"\n fxFlex=\"nogrow\"\n #passwordInput\n formControlName=\"password\">\n <mat-error *rxapFormControlError=\"let error from 'password'; if: 'required'\">\n Password is <strong>required</strong>\n </mat-error>\n <button tabIndex=\"-1\" matSuffix *ngIf=\"passwordInput.type === 'password'\" mat-icon-button type=\"button\" (click)=\"passwordInput.type = 'test'\">\n <mat-icon>visibility</mat-icon>\n </button>\n <button tabIndex=\"-1\" matSuffix *ngIf=\"passwordInput.type === 'text'\" mat-icon-button type=\"button\" (click)=\"passwordInput.type = 'password'\">\n <mat-icon>visibility_off</mat-icon>\n </button>\n </mat-form-field>\n\n </div>\n\n <div class=\"sub-controls\" fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxLayoutGap=\"16px\">\n\n <mat-checkbox class=\"remember-input\" fxFlex=\"nogrow\" formControlName=\"remember\">Remember me</mat-checkbox>\n\n <div fxFlex=\"nogrow\"\n matTooltip=\"Please enter a valid email address\"\n matTooltipPosition=\"above\"\n [matTooltipDisabled]=\"form.control.controls.email.valid\">\n <button color=\"accent\"\n type=\"button\"\n mat-button\n (click)=\"requestPasswordReset(form.value.email)\"\n [disabled]=\"!form.value.email || form.control.controls.email.hasError('email')\">\n <span fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayoutAlign=\"space-between center\">\n <mat-progress-spinner *ngIf=\"requestingPasswordReset$ | async\" mode=\"indeterminate\" [diameter]=\"15\"></mat-progress-spinner>\n <span fxFlex=\"nogrow\">Password forgotten</span>\n </span>\n </button>\n </div>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button mat-raised-button color=\"primary\" type=\"submit\" rxapFormControlMarkDirty>Login</button>\n </div>\n\n </div>\n\n </div>\n\n <div *rxapFormSubmitFailed=\"let error\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <mat-error>{{ error.message }}</mat-error>\n </div>\n\n <mat-progress-bar *rxapFormSubmitting mode=\"indeterminate\" class=\"loading-bar\"></mat-progress-bar>\n\n</form>\n", styles: [".inner{padding:48px;position:relative;margin:16px 0}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}.inner .content{width:304px;max-width:calc(100vw - 112px)}.inner .content .email-input,.inner .content .password-input{width:100%}.inner .content .email-input .prefix-icon,.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .email-input ::ng-deep .mat-form-field-prefix,.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:128px;text-transform:uppercase}.inner .sub-controls>*{margin-bottom:8px}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: FormDirective, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: ["initial", "rxapForm", "submitMethod"], outputs: ["ngSubmit", "rxapSubmit", "invalidSubmit", "submitSuccessful"], exportAs: ["rxapForm"] }, { kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: FormControlErrorDirective, selector: "[rxapFormControlError]", inputs: ["rxapFormControlErrorFrom", "rxapFormControlErrorIf"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i6.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i7.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: FormControlMarkDirtyDirective, selector: "[rxapFormControlMarkDirty]" }, { kind: "directive", type: FormSubmitFailedDirective, selector: "[rxapFormSubmitFailed]" }, { kind: "directive", type: FormSubmittingDirective, selector: "[rxapFormSubmitting]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i10.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], animations: [
195
- fadeAnimation
196
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
197
- }
198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoginComponent, decorators: [{
199
- type: Component,
200
- args: [{ selector: 'rxap-login', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
201
- LoginFormProviders,
202
- {
203
- provide: ErrorStateMatcher,
204
- useClass: ShowOnDirtyErrorStateMatcher
205
- }
206
- ], animations: [
207
- fadeAnimation
208
- ], standalone: true, imports: [
209
- ReactiveFormsModule,
210
- FormDirective,
211
- FlexModule,
212
- MatIconModule,
213
- MatFormFieldModule,
214
- MatInputModule,
215
- FormControlErrorDirective,
216
- NgIf,
217
- MatButtonModule,
218
- MatCheckboxModule,
219
- MatTooltipModule,
220
- MatProgressSpinnerModule,
221
- FormControlMarkDirtyDirective,
222
- FormSubmitFailedDirective,
223
- FormSubmittingDirective,
224
- MatProgressBarModule,
225
- AsyncPipe
226
- ], template: "<form rxapForm class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" #form=\"rxapForm\" fxLayoutGap=\"32px\" [@fadeAnimation]=\"'in'\"\n novalidate>\n\n <div class=\"header\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFlex=\"nogrow\">\n\n <mat-icon fxFlex=\"nogrow\" color=\"primary\" class=\"avatar-icon\">account_circle</mat-icon>\n\n </div>\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\">\n\n <mat-form-field class=\"email-input\">\n <mat-icon matPrefix inline>email</mat-icon>\n <mat-label i18n>Email</mat-label>\n <input matInput\n i18n-placeholder\n placeholder=\"Enter your email address\"\n type=\"email\"\n fxFlex=\"nogrow\"\n formControlName=\"email\">\n <mat-error *rxapFormControlError=\"let error from 'email'; if: 'required'\">\n Email is <strong>required</strong>\n </mat-error>\n <mat-error *rxapFormControlError=\"let error from 'email'; if: 'email'\">\n Please enter a valid email address\n </mat-error>\n </mat-form-field>\n\n <mat-form-field class=\"password-input\">\n <mat-icon matPrefix inline>vpn_key</mat-icon>\n <mat-label i18n>Password</mat-label>\n <input matInput\n type=\"password\"\n i18n-placeholder\n placeholder=\"Enter your password\"\n fxFlex=\"nogrow\"\n #passwordInput\n formControlName=\"password\">\n <mat-error *rxapFormControlError=\"let error from 'password'; if: 'required'\">\n Password is <strong>required</strong>\n </mat-error>\n <button tabIndex=\"-1\" matSuffix *ngIf=\"passwordInput.type === 'password'\" mat-icon-button type=\"button\" (click)=\"passwordInput.type = 'test'\">\n <mat-icon>visibility</mat-icon>\n </button>\n <button tabIndex=\"-1\" matSuffix *ngIf=\"passwordInput.type === 'text'\" mat-icon-button type=\"button\" (click)=\"passwordInput.type = 'password'\">\n <mat-icon>visibility_off</mat-icon>\n </button>\n </mat-form-field>\n\n </div>\n\n <div class=\"sub-controls\" fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\" fxLayoutGap=\"16px\">\n\n <mat-checkbox class=\"remember-input\" fxFlex=\"nogrow\" formControlName=\"remember\">Remember me</mat-checkbox>\n\n <div fxFlex=\"nogrow\"\n matTooltip=\"Please enter a valid email address\"\n matTooltipPosition=\"above\"\n [matTooltipDisabled]=\"form.control.controls.email.valid\">\n <button color=\"accent\"\n type=\"button\"\n mat-button\n (click)=\"requestPasswordReset(form.value.email)\"\n [disabled]=\"!form.value.email || form.control.controls.email.hasError('email')\">\n <span fxLayout=\"row\" fxLayoutGap=\"8px\" fxLayoutAlign=\"space-between center\">\n <mat-progress-spinner *ngIf=\"requestingPasswordReset$ | async\" mode=\"indeterminate\" [diameter]=\"15\"></mat-progress-spinner>\n <span fxFlex=\"nogrow\">Password forgotten</span>\n </span>\n </button>\n </div>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button mat-raised-button color=\"primary\" type=\"submit\" rxapFormControlMarkDirty>Login</button>\n </div>\n\n </div>\n\n </div>\n\n <div *rxapFormSubmitFailed=\"let error\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <mat-error>{{ error.message }}</mat-error>\n </div>\n\n <mat-progress-bar *rxapFormSubmitting mode=\"indeterminate\" class=\"loading-bar\"></mat-progress-bar>\n\n</form>\n", styles: [".inner{padding:48px;position:relative;margin:16px 0}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}.inner .content{width:304px;max-width:calc(100vw - 112px)}.inner .content .email-input,.inner .content .password-input{width:100%}.inner .content .email-input .prefix-icon,.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .email-input ::ng-deep .mat-form-field-prefix,.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:128px;text-transform:uppercase}.inner .sub-controls>*{margin-bottom:8px}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"] }]
227
- }], ctorParameters: function () { return [{ type: i2.RxapAuthenticationService, decorators: [{
228
- type: Inject,
229
- args: [RxapAuthenticationService]
230
- }] }, { type: i12.MatSnackBar, decorators: [{
231
- type: Inject,
232
- args: [MatSnackBar]
233
- }] }]; } });
234
-
235
- class AuthenticationContainerComponent {
236
- prepareRoute(outlet) {
237
- return outlet.isActivated ? outlet.activatedRoute : 'true';
238
- }
239
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AuthenticationContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
240
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: AuthenticationContainerComponent, isStandalone: true, selector: "rxap-authentication-container", host: { classAttribute: "rxap-authentication-container" }, ngImport: i0, template: "<div class=\"container\" [@routeAnimations]=\"prepareRoute(outlet)\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n <ng-content></ng-content>\n\n</div>\n", styles: [".container{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;overflow-x:hidden}.container .split{position:absolute;top:0;left:0;right:0;bottom:65vh;z-index:-10}\n"], dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], animations: [
241
- trigger('routeAnimations', [
242
- transition(':enter', [
243
- style({ opacity: 0 }),
244
- animate('512ms', style({ opacity: 1 }))
245
- ]),
246
- transition(':leave', [
247
- style({ opacity: 1 }),
248
- animate('512ms', style({ opacity: 0 }))
249
- ])
250
- ])
251
- ] }); }
252
- }
253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: AuthenticationContainerComponent, decorators: [{
254
- type: Component,
255
- args: [{ selector: 'rxap-authentication-container', host: { class: 'rxap-authentication-container' }, animations: [
256
- trigger('routeAnimations', [
257
- transition(':enter', [
258
- style({ opacity: 0 }),
259
- animate('512ms', style({ opacity: 1 }))
260
- ]),
261
- transition(':leave', [
262
- style({ opacity: 1 }),
263
- animate('512ms', style({ opacity: 0 }))
264
- ])
265
- ])
266
- ], standalone: true, imports: [RouterOutlet], template: "<div class=\"container\" [@routeAnimations]=\"prepareRoute(outlet)\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n <ng-content></ng-content>\n\n</div>\n", styles: [".container{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;overflow-x:hidden}.container .split{position:absolute;top:0;left:0;right:0;bottom:65vh;z-index:-10}\n"] }]
267
- }] });
268
-
269
- const RXAP_RESET_PASSWORD_FORM = 'rxap-reset-password';
270
- class ResetPasswordFormSubmitMethod {
271
- constructor(route, authentication, snackBar, router) {
272
- this.route = route;
273
- this.authentication = authentication;
274
- this.snackBar = snackBar;
275
- this.router = router;
276
- }
277
- call(value) {
278
- return this.route.params
279
- .pipe(take(1), map((params) => params.token), switchMap((token) => this.authentication.sendPasswordReset(value.password, token)), tap((result) => {
280
- if (result) {
281
- this.snackBar.open('Password reset was successful.', undefined, {
282
- duration: 3500,
283
- });
284
- return this.router.navigate(['/']);
285
- }
286
- return Promise.resolve();
287
- }))
288
- .toPromise();
289
- }
290
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ResetPasswordFormSubmitMethod, deps: [{ token: ActivatedRoute }, { token: RxapAuthenticationService }, { token: MatSnackBar }, { token: Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
291
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ResetPasswordFormSubmitMethod }); }
292
- }
293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ResetPasswordFormSubmitMethod, decorators: [{
294
- type: Injectable
295
- }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute, decorators: [{
296
- type: Inject,
297
- args: [ActivatedRoute]
298
- }] }, { type: i2.RxapAuthenticationService, decorators: [{
299
- type: Inject,
300
- args: [RxapAuthenticationService]
301
- }] }, { type: i12.MatSnackBar, decorators: [{
302
- type: Inject,
303
- args: [MatSnackBar]
304
- }] }, { type: i1$1.Router, decorators: [{
305
- type: Inject,
306
- args: [Router]
307
- }] }]; } });
308
- let ResetPasswordForm = class ResetPasswordForm {
309
- passwordEqual() {
310
- if (this.password.value !== this.passwordRepeat.value) {
311
- return { equal: 'passwords are not equal' };
312
- }
313
- return null;
314
- }
315
- resetRepeat() {
316
- this.passwordRepeat.reset();
317
- }
318
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ResetPasswordForm, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
319
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ResetPasswordForm }); }
320
- };
321
- __decorate([
322
- UseFormControl({
323
- validators: [Validators.required],
324
- }),
325
- __metadata("design:type", RxapFormControl)
326
- ], ResetPasswordForm.prototype, "password", void 0);
327
- __decorate([
328
- UseFormControl({
329
- validators: [Validators.required],
330
- }),
331
- __metadata("design:type", RxapFormControl)
332
- ], ResetPasswordForm.prototype, "passwordRepeat", void 0);
333
- __decorate([
334
- ControlValidator('passwordRepeat'),
335
- __metadata("design:type", Function),
336
- __metadata("design:paramtypes", []),
337
- __metadata("design:returntype", void 0)
338
- ], ResetPasswordForm.prototype, "passwordEqual", null);
339
- __decorate([
340
- ControlSetValue('password'),
341
- __metadata("design:type", Function),
342
- __metadata("design:paramtypes", []),
343
- __metadata("design:returntype", void 0)
344
- ], ResetPasswordForm.prototype, "resetRepeat", null);
345
- ResetPasswordForm = __decorate([
346
- RxapForm({
347
- id: RXAP_RESET_PASSWORD_FORM,
348
- })
349
- ], ResetPasswordForm);
350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ResetPasswordForm, decorators: [{
351
- type: Injectable
352
- }], propDecorators: { password: [], passwordRepeat: [], passwordEqual: [], resetRepeat: [] } });
353
- const ResetPasswordFormProviders = [
354
- ResetPasswordForm,
355
- {
356
- provide: RXAP_FORM_DEFINITION_BUILDER,
357
- useFactory: (injector) => new RxapFormBuilder(ResetPasswordForm, injector),
358
- deps: [INJECTOR],
359
- },
360
- {
361
- provide: RXAP_FORM_DEFINITION,
362
- useFactory: (builder) => builder.build(),
363
- deps: [RXAP_FORM_DEFINITION_BUILDER],
364
- },
365
- {
366
- provide: RXAP_FORM_SUBMIT_METHOD,
367
- useClass: ResetPasswordFormSubmitMethod,
368
- },
369
- ];
370
-
371
- class ResetPasswordComponent {
372
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ResetPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
373
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: ResetPasswordComponent, isStandalone: true, selector: "rxap-reset-password", providers: [
374
- ResetPasswordFormProviders,
375
- {
376
- provide: ErrorStateMatcher,
377
- useClass: ShowOnDirtyErrorStateMatcher
378
- }
379
- ], ngImport: i0, template: "<form rxapForm class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" #form=\"rxapForm\" fxLayoutGap=\"32px\" novalidate\n [@fadeAnimation]=\"'in'\">\n\n <div class=\"header\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFlex=\"nogrow\">\n\n <mat-icon fxFlex=\"nogrow\" color=\"primary\" class=\"avatar-icon\">vpn_key</mat-icon>\n\n </div>\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\">\n\n <mat-form-field class=\"password-input\">\n <mat-icon matPrefix inline>vpn_key</mat-icon>\n <mat-label i18n>New password</mat-label>\n <input matInput\n type=\"password\"\n i18n-placeholder\n placeholder=\"Enter your new password\"\n fxFlex=\"nogrow\"\n #passwordInput\n formControlName=\"password\">\n <mat-error *rxapFormControlError=\"let error from 'password'; if: 'required'\">\n Password is <strong>required</strong>\n </mat-error>\n <button tabIndex=\"-1\" matSuffix *ngIf=\"passwordInput.type === 'password'\" mat-icon-button type=\"button\" (click)=\"passwordInput.type = 'test'\">\n <mat-icon>visibility</mat-icon>\n </button>\n <button tabIndex=\"-1\" matSuffix *ngIf=\"passwordInput.type === 'text'\" mat-icon-button type=\"button\" (click)=\"passwordInput.type = 'password'\">\n <mat-icon>visibility_off</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field class=\"password-input\">\n <mat-icon matPrefix inline>vpn_key</mat-icon>\n <mat-label i18n>Repeat password</mat-label>\n <input matInput\n type=\"password\"\n i18n-placeholder\n placeholder=\"Enter your new password again\"\n fxFlex=\"nogrow\"\n #passwordRepeatInput\n formControlName=\"passwordRepeat\">\n <mat-error *rxapFormControlError=\"let error from 'passwordRepeat'; if: 'required'\">\n Password is <strong>required</strong>\n </mat-error>\n <mat-error *rxapFormControlError=\"let error from 'passwordRepeat'; if: 'equal'\">\n Entered password are <strong>not equal</strong>\n </mat-error>\n <button tabIndex=\"-1\"\n matSuffix\n *ngIf=\"passwordRepeatInput.type === 'password'\"\n mat-icon-button\n type=\"button\"\n (click)=\"passwordRepeatInput.type = 'text'\">\n <mat-icon>visibility</mat-icon>\n </button>\n <button tabIndex=\"-1\"\n matSuffix\n *ngIf=\"passwordRepeatInput.type === 'text'\"\n mat-icon-button\n type=\"button\"\n (click)=\"passwordRepeatInput.type = 'password'\">\n <mat-icon>visibility_off</mat-icon>\n </button>\n </mat-form-field>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button mat-raised-button color=\"primary\" type=\"submit\" rxapFormControlMarkDirty>Reset password</button>\n </div>\n\n </div>\n\n </div>\n\n <div *rxapFormSubmitFailed=\"let error\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <mat-error>{{ error.message }}</mat-error>\n </div>\n\n <mat-progress-bar *rxapFormSubmitting mode=\"indeterminate\" class=\"loading-bar\"></mat-progress-bar>\n\n</form>\n", styles: [".inner{padding:48px;position:relative;margin:16px 0}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}.inner .content{width:304px;max-width:calc(100vw - 112px)}.inner .content .password-input{width:100%}.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:256px;text-transform:uppercase}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: FormDirective, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: ["initial", "rxapForm", "submitMethod"], outputs: ["ngSubmit", "rxapSubmit", "invalidSubmit", "submitSuccessful"], exportAs: ["rxapForm"] }, { kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: FormControlErrorDirective, selector: "[rxapFormControlError]", inputs: ["rxapFormControlErrorFrom", "rxapFormControlErrorIf"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i6.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: FormControlMarkDirtyDirective, selector: "[rxapFormControlMarkDirty]" }, { kind: "directive", type: FormSubmitFailedDirective, selector: "[rxapFormSubmitFailed]" }, { kind: "directive", type: FormSubmittingDirective, selector: "[rxapFormSubmitting]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i10.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], animations: [
380
- fadeAnimation
381
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
382
- }
383
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ResetPasswordComponent, decorators: [{
384
- type: Component,
385
- args: [{ selector: 'rxap-reset-password', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
386
- ResetPasswordFormProviders,
387
- {
388
- provide: ErrorStateMatcher,
389
- useClass: ShowOnDirtyErrorStateMatcher
390
- }
391
- ], animations: [
392
- fadeAnimation
393
- ], standalone: true, imports: [
394
- ReactiveFormsModule,
395
- FormDirective,
396
- FlexModule,
397
- MatIconModule,
398
- MatFormFieldModule,
399
- MatInputModule,
400
- FormControlErrorDirective,
401
- NgIf,
402
- MatButtonModule,
403
- FormControlMarkDirtyDirective,
404
- FormSubmitFailedDirective,
405
- FormSubmittingDirective,
406
- MatProgressBarModule
407
- ], template: "<form rxapForm class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" #form=\"rxapForm\" fxLayoutGap=\"32px\" novalidate\n [@fadeAnimation]=\"'in'\">\n\n <div class=\"header\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFlex=\"nogrow\">\n\n <mat-icon fxFlex=\"nogrow\" color=\"primary\" class=\"avatar-icon\">vpn_key</mat-icon>\n\n </div>\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\">\n\n <mat-form-field class=\"password-input\">\n <mat-icon matPrefix inline>vpn_key</mat-icon>\n <mat-label i18n>New password</mat-label>\n <input matInput\n type=\"password\"\n i18n-placeholder\n placeholder=\"Enter your new password\"\n fxFlex=\"nogrow\"\n #passwordInput\n formControlName=\"password\">\n <mat-error *rxapFormControlError=\"let error from 'password'; if: 'required'\">\n Password is <strong>required</strong>\n </mat-error>\n <button tabIndex=\"-1\" matSuffix *ngIf=\"passwordInput.type === 'password'\" mat-icon-button type=\"button\" (click)=\"passwordInput.type = 'test'\">\n <mat-icon>visibility</mat-icon>\n </button>\n <button tabIndex=\"-1\" matSuffix *ngIf=\"passwordInput.type === 'text'\" mat-icon-button type=\"button\" (click)=\"passwordInput.type = 'password'\">\n <mat-icon>visibility_off</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field class=\"password-input\">\n <mat-icon matPrefix inline>vpn_key</mat-icon>\n <mat-label i18n>Repeat password</mat-label>\n <input matInput\n type=\"password\"\n i18n-placeholder\n placeholder=\"Enter your new password again\"\n fxFlex=\"nogrow\"\n #passwordRepeatInput\n formControlName=\"passwordRepeat\">\n <mat-error *rxapFormControlError=\"let error from 'passwordRepeat'; if: 'required'\">\n Password is <strong>required</strong>\n </mat-error>\n <mat-error *rxapFormControlError=\"let error from 'passwordRepeat'; if: 'equal'\">\n Entered password are <strong>not equal</strong>\n </mat-error>\n <button tabIndex=\"-1\"\n matSuffix\n *ngIf=\"passwordRepeatInput.type === 'password'\"\n mat-icon-button\n type=\"button\"\n (click)=\"passwordRepeatInput.type = 'text'\">\n <mat-icon>visibility</mat-icon>\n </button>\n <button tabIndex=\"-1\"\n matSuffix\n *ngIf=\"passwordRepeatInput.type === 'text'\"\n mat-icon-button\n type=\"button\"\n (click)=\"passwordRepeatInput.type = 'password'\">\n <mat-icon>visibility_off</mat-icon>\n </button>\n </mat-form-field>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button mat-raised-button color=\"primary\" type=\"submit\" rxapFormControlMarkDirty>Reset password</button>\n </div>\n\n </div>\n\n </div>\n\n <div *rxapFormSubmitFailed=\"let error\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <mat-error>{{ error.message }}</mat-error>\n </div>\n\n <mat-progress-bar *rxapFormSubmitting mode=\"indeterminate\" class=\"loading-bar\"></mat-progress-bar>\n\n</form>\n", styles: [".inner{padding:48px;position:relative;margin:16px 0}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px}.inner .content{width:304px;max-width:calc(100vw - 112px)}.inner .content .password-input{width:100%}.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:256px;text-transform:uppercase}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"] }]
408
- }] });
409
-
410
- class LoadingComponent {
411
- constructor(authentication, router) {
412
- this.authentication = authentication;
413
- this.router = router;
414
- }
415
- ngOnInit() {
416
- // TODO : remove the concept of isAuthenticated$
417
- if (this.authentication.isAuthenticated$) {
418
- this.subscription = this.authentication.isAuthenticated$
419
- .pipe(filter((isAuthenticated) => isAuthenticated !== null), tap(() => this.router.navigate(['/', 'authentication', 'login'])))
420
- .subscribe();
421
- }
422
- }
423
- ngOnDestroy() {
424
- this.subscription?.unsubscribe();
425
- }
426
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoadingComponent, deps: [{ token: RxapAuthenticationService }, { token: Router }], target: i0.ɵɵFactoryTarget.Component }); }
427
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: LoadingComponent, isStandalone: true, selector: "rxap-auth-loading", host: { classAttribute: "rxap-auth-loading" }, ngImport: i0, template: "<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n", styles: [".loading-bar{position:absolute;bottom:65vh;left:0;right:0;top:auto}\n"], dependencies: [{ kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i10.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
428
- }
429
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: LoadingComponent, decorators: [{
430
- type: Component,
431
- args: [{ selector: 'rxap-auth-loading', host: { class: 'rxap-auth-loading' }, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatProgressBarModule], template: "<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n", styles: [".loading-bar{position:absolute;bottom:65vh;left:0;right:0;top:auto}\n"] }]
432
- }], ctorParameters: function () { return [{ type: i2.RxapAuthenticationService, decorators: [{
433
- type: Inject,
434
- args: [RxapAuthenticationService]
435
- }] }, { type: i1$1.Router, decorators: [{
436
- type: Inject,
437
- args: [Router]
438
- }] }]; } });
439
-
440
- const AuthenticationRoutes = [
441
- {
442
- path: 'authentication',
443
- component: AuthenticationContainerComponent,
444
- children: [
445
- {
446
- canActivate: [RxapAuthenticationGuard],
447
- path: 'login',
448
- component: LoginComponent
449
- },
450
- {
451
- canActivate: [RxapAuthenticationGuard],
452
- path: 'reset-password/:token',
453
- component: ResetPasswordComponent
454
- },
455
- {
456
- path: 'loading',
457
- component: LoadingComponent
458
- },
459
- {
460
- path: '**',
461
- redirectTo: 'login'
462
- }
463
- ]
464
- }
465
- ];
466
-
467
- /**
468
- * Generated bundle index. Do not edit.
469
- */
470
-
471
- export { AuthenticationContainerComponent, AuthenticationRoutes, LoadingComponent, LoginComponent, LoginForm, LoginFormProviders, LoginFormSubmitMethod, LoginFormSubmitSuccessful, ResetPasswordComponent, fadeAnimation };
472
- //# sourceMappingURL=rxap-authentication-components.mjs.map