@dbg-riskit/angular-login 9999.9999.9999-rc.41311 → 9999.9999.9999-rc.445048

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.
@@ -0,0 +1,80 @@
1
+ import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
2
+ import { AUTH_PROVIDER, SECONDARY_LOGO } from '@dbg-riskit/angular-common';
3
+ import { toErrorMessage } from '@dbg-riskit/angular-error';
4
+ import { BaseComponent } from '@dbg-riskit/angular-view';
5
+ import { first, takeUntil } from 'rxjs/operators';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "@dbg-riskit/angular-auth";
8
+ import * as i2 from "@angular/common";
9
+ import * as i3 from "@angular/forms";
10
+ import * as i4 from "@dbg-riskit/angular-view";
11
+ import * as i5 from "@angular/material/button";
12
+ import * as i6 from "@angular/material/card";
13
+ import * as i7 from "@angular/material/form-field";
14
+ import * as i8 from "@angular/material/icon";
15
+ import * as i9 from "@angular/material/input";
16
+ import * as i10 from "@angular/material/progress-spinner";
17
+ export class LoginComponent extends BaseComponent {
18
+ constructor(authProvider, changeDetectorRef, authRoutingFlowService, secondaryLogo) {
19
+ super();
20
+ this.authProvider = authProvider;
21
+ this.changeDetectorRef = changeDetectorRef;
22
+ this.authRoutingFlowService = authRoutingFlowService;
23
+ this.secondaryLogo = secondaryLogo;
24
+ /**
25
+ * Control for "login button-to-spinner".
26
+ */
27
+ this.loggingIn = false;
28
+ // Update component state on login status change
29
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
30
+ }
31
+ ngAfterViewInit() {
32
+ this.authRoutingFlowService.loginViaService().pipe(takeUntil(this.destroyed)).subscribe(() => {
33
+ this.changeDetectorRef.markForCheck();
34
+ }, (err) => {
35
+ this.errorMessage = toErrorMessage(err).message;
36
+ this.changeDetectorRef.markForCheck();
37
+ });
38
+ }
39
+ get isDirectFlow() {
40
+ return this.authRoutingFlowService.directFlow;
41
+ }
42
+ get authStatus() {
43
+ return this.authProvider.loggedIn;
44
+ }
45
+ get userProfile() {
46
+ return this.authProvider.userProfile;
47
+ }
48
+ login() {
49
+ this.loggingIn = true;
50
+ this.authRoutingFlowService.login(this.username, this.password).pipe(first()).subscribe((res) => {
51
+ if (!res) {
52
+ this.errorMessage = 'Authentication failed. Server did not generate a token.';
53
+ }
54
+ this.loggingIn = false;
55
+ this.changeDetectorRef.markForCheck();
56
+ }, () => {
57
+ this.loggingIn = false;
58
+ this.errorMessage = 'Authentication failed. Is the username and password correct?';
59
+ this.changeDetectorRef.markForCheck();
60
+ });
61
+ }
62
+ get logo() {
63
+ return this.secondaryLogo;
64
+ }
65
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component }); }
66
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoginComponent, selector: "ng-component", host: { properties: { "class.risk-login-form": "true" } }, usesInheritance: true, ngImport: i0, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-header>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n <risk-flex-spacer></risk-flex-spacer>\n <img [src]=\"logo\" alt=\"Company logo\">\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-mdc-card-actions img{margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:flex}.risk-login-form-flex-wrapper>div{flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { kind: "component", type: i5.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.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i6.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i6.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i6.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i6.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.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: "component", type: i4.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { kind: "component", type: i4.FlexSpacerComponent, selector: "risk-flex-spacer" }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
67
+ }
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginComponent, decorators: [{
69
+ type: Component,
70
+ args: [{ host: {
71
+ '[class.risk-login-form]': 'true'
72
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-header>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n <risk-flex-spacer></risk-flex-spacer>\n <img [src]=\"logo\" alt=\"Company logo\">\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-mdc-card-actions img{margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:flex}.risk-login-form-flex-wrapper>div{flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"] }]
73
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
74
+ type: Inject,
75
+ args: [AUTH_PROVIDER]
76
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.AuthRoutingFlowService }, { type: undefined, decorators: [{
77
+ type: Inject,
78
+ args: [SECONDARY_LOGO]
79
+ }] }]; } });
80
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGtnL2RiZy1yaXNraXQvYW5ndWxhci1sb2dpbi9zcmMvbGliL2xvZ2luLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3BrZy9kYmctcmlza2l0L2FuZ3VsYXItbG9naW4vc3JjL2xpYi9sb2dpbi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWdCLHVCQUF1QixFQUFxQixTQUFTLEVBQUUsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRzNHLE9BQU8sRUFBQyxhQUFhLEVBQUUsY0FBYyxFQUFDLE1BQU0sNEJBQTRCLENBQUM7QUFDekUsT0FBTyxFQUFhLGNBQWMsRUFBQyxNQUFNLDJCQUEyQixDQUFDO0FBQ3JFLE9BQU8sRUFBQyxhQUFhLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQUl2RCxPQUFPLEVBQUMsS0FBSyxFQUFFLFNBQVMsRUFBQyxNQUFNLGdCQUFnQixDQUFDOzs7Ozs7Ozs7Ozs7QUFjaEQsTUFBTSxPQUFPLGNBQWUsU0FBUSxhQUFhO0lBc0I3QyxZQUEyRCxZQUEwQixFQUNqRCxpQkFBb0MsRUFDcEMsc0JBQTh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ydmljZTogQXV0aFJvdXRpbmdGbG93U2VydmljZSxcbiAgICAgICAgICAgICAgICAgICAgICAgQEluamVjdChTRUNPTkRBUllfTE9HTykgcHJpdmF0ZSByZWFkb25seSBzZWNvbmRhcnlMb2dvOiBzdHJpbmcpIHtcbiAgICAgICAgc3VwZXIoKTtcbiAgICAgICAgLy8gVXBkYXRlIGNvbXBvbmVudCBzdGF0ZSBvbiBsb2dpbiBzdGF0dXMgY2hhbmdlXG4gICAgICAgIHRoaXMuYXV0aFByb3ZpZGVyLmxvZ2dlZEluU3RyZWFtLnBpcGUoXG4gICAgICAgICAgICB0YWtlVW50aWwodGhpcy5kZXN0cm95ZWQpXG4gICAgICAgICkuc3Vic2NyaWJlKCgpID0+IHRoaXMuY2hhbmdlRGV0ZWN0b3JSZWYubWFya0ZvckNoZWNrKCkpO1xuICAgIH1cblxuICAgIHB1YmxpYyBuZ0FmdGVyVmlld0luaXQoKTogdm9pZCB7XG4gICAgICAgIHRoaXMuYXV0aFJvdXRpbmdGbG93U2VydmljZS5sb2dpblZpYVNlcnZpY2UoKS5waXBlKFxuICAgICAgICAgICAgdGFrZVVudGlsKHRoaXMuZGVzdHJveWVkKVxuICAgICAgICApLnN1YnNjcmliZShcbiAgICAgICAgICAgICgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmNoYW5nZURldGVjdG9yUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIChlcnI6IEVycm9yVHlwZXMpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmVycm9yTWVzc2FnZSA9IHRvRXJyb3JNZXNzYWdlKGVycikubWVzc2FnZTtcbiAgICAgICAgICAgICAgICB0aGlzLmNoYW5nZURldGVjdG9yUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHB1YmxpYyBnZXQgaXNEaXJlY3RGbG93KCk6IGJvb2xlYW4ge1xuICAgIC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ICAgICAgPGlucHV0IG1hdElucHV0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJ0ZXh0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI9XCJVc2VybmFtZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU9XCJ1c2VybmFtZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsobmdNb2RlbCldPVwidXNlcm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRvZm9jdXM+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L21hdC1mb3JtLWZpZWxkPlxuICAgICAgICAgICAgICAgICAgICAgICAgPG1hdC1mb3JtLWZpZWxkIGNsYXNzPVwicmlzay1mdWxsLXdpZHRoXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IG1hdElucHV0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU9XCJwYXNzd29yZFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiUGFzc3dvcmRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lPVwicGFzc3dvcmRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbKG5nTW9kZWwpXT1cInBhc3N3b3JkXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L21hdC1mb3JtLWZpZWxkPlxuICAgICAgICAgICAgICAgICAgICA8L21hdC1jYXJkLWNvbnRlbnQ+XG4gICAgICAgICAgICAgICAgICAgIDxtYXQtY2FyZC1hY3Rpb25zPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiAqbmdJZj1cIiFsb2dnaW5nSW5cIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXQtcmFpc2VkLWJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcj1cInByaW1hcnlcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwic3VibWl0XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgU2lnbiBpblxuICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgICAgICA8bWF0LXNwaW5uZXIgKm5nSWY9XCJsb2dnaW5nSW5cIiBbZGlhbWV0ZXJdPVwiMzZcIj48L21hdC1zcGlubmVyPlxuICAgICAgICAgICAgICAgICAgICAgICAgPHJpc2stZmxleC1zcGFjZXI+PC9yaXNrLWZsZXgtc3BhY2VyPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGltZyBbc3JjXT1cImxvZ29cIiBhbHQ9XCJDb21wYW55IGxvZ29cIj5cbiAgICAgICAgICAgICAgICAgICAgPC9tYXQtY2FyZC1hY3Rpb25zPlxuICAgICAgICAgICAgICAgIDwvbWF0LWNhcmQ+XG4gICAgICAgICAgICA8L2Zvcm0+XG4gICAgICAgIDwvbmctdGVtcGxhdGU+XG5cbiAgICAgICAgPG5nLXRlbXBsYXRlIFtuZ0lmXT1cImF1dGhTdGF0dXMgfCBhc3luY1wiIFtuZ0lmRWxzZV09XCJsb2dnZWRPdXRcIj5cbiAgICAgICAgICAgIDxuZy10ZW1wbGF0ZSBbbmdJZl09XCJ1c2VyUHJvZmlsZSB8IGFzeW5jXCIgbGV0LXVzZXI9XCJuZ0lmXCI+XG4gICAgICAgICAgICAgICAgPHJpc2stZ29vZCAqbmdJZj1cInVzZXI/Lm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgW21lc3NhZ2VdPVwiJ1N1Y2Nlc3NmdWxseSBsb2dnZWQgaW4gYXMgJyArIHVzZXIubmFtZSArICcuJ1wiPjwvcmlzay1nb29kPlxuICAgICAgICAgICAgICAgIDxyaXNrLWdvb2QgKm5nSWY9XCI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1c2VyOiB7e2Vycm9yTWVzc2FnZX19PC9oMz5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyaXNrLWxvZ2luLWZvcm0tZmxleC13cmFwcGVyXCI+XG4gICAgICAgICAgICAgICAgPGRpdj48L2Rpdj5cbiAgICAgICAgICAgICAgICA8YnV0dG9uIG1hdC1idXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgIChjbGljayk9XCJsb2dpbigpXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yPVwicHJpbWFyeVwiXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCI+XG4gICAgICAgICAgICAgICAgICAgIDxtYXQtaWNvbj5hdXRvcmVuZXc8L21hdC1pY29uPlxuICAgICAgICAgICAgICAgICAgICBSZXRyeVxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgIDxkaXY+PC9kaXY+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC9uZy10ZW1wbGF0ZT5cbiAgICA8L2Rpdj5cblxuICAgIDxyaXNrLWZsZXgtc3BhY2VyPjwvcmlzay1mbGV4LXNwYWNlcj5cbjwvcmlzay1mbGV4PlxuIl19
@@ -0,0 +1,83 @@
1
+ import { ChangeDetectionStrategy, Component, Directive, HostBinding, Inject, Input } from '@angular/core';
2
+ import { AUTH_PROVIDER } from '@dbg-riskit/angular-common';
3
+ import { BaseComponent } from '@dbg-riskit/angular-view';
4
+ import { first, takeUntil } from 'rxjs/operators';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@dbg-riskit/angular-auth";
7
+ import * as i2 from "@angular/common";
8
+ import * as i3 from "@angular/material/button";
9
+ import * as i4 from "@angular/material/icon";
10
+ import * as i5 from "@angular/material/menu";
11
+ export class LoginMenuComponentTitleDirective {
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
13
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 }); }
14
+ }
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponentTitleDirective, decorators: [{
16
+ type: Directive,
17
+ args: [{
18
+ selector: 'risk-login-menu-title-horizontal, '
19
+ + 'risk-login-menu-title-vertical',
20
+ host: {
21
+ '[class.risk-login-menu-title]': 'true'
22
+ }
23
+ }]
24
+ }] });
25
+ export class LoginMenuItemsDirective {
26
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
27
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuItemsDirective, selector: "risk-login-menu-before-items-horizontal, risk-login-menu-before-items-vertical,risk-login-menu-after-items-horizontal,risk-login-menu-after-items-vertical", ngImport: i0 }); }
28
+ }
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuItemsDirective, decorators: [{
30
+ type: Directive,
31
+ args: [{
32
+ selector: 'risk-login-menu-before-items-horizontal,'
33
+ + ' risk-login-menu-before-items-vertical,'
34
+ + 'risk-login-menu-after-items-horizontal,'
35
+ + 'risk-login-menu-after-items-vertical'
36
+ }]
37
+ }] });
38
+ export class LoginMenuComponent extends BaseComponent {
39
+ get isRow() {
40
+ return this.orientation === 'row';
41
+ }
42
+ get isColumn() {
43
+ return this.orientation === 'column';
44
+ }
45
+ constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
46
+ super();
47
+ this.authProvider = authProvider;
48
+ this.authRoutingFlowService = authRoutingFlowService;
49
+ this.changeDetectorRef = changeDetectorRef;
50
+ this.orientation = 'row';
51
+ // Update menu state on login status change
52
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
53
+ }
54
+ menuClosed() {
55
+ this.changeDetectorRef.markForCheck();
56
+ }
57
+ get authStatus() {
58
+ return this.authProvider.loggedIn;
59
+ }
60
+ logout() {
61
+ this.authRoutingFlowService.logout().pipe(first()).subscribe();
62
+ }
63
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
64
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuComponent, selector: "risk-login-menu", inputs: { orientation: "orientation" }, host: { properties: { "class.risk-login-menu": "true", "class.risk-login-menu-flex-row": "this.isRow", "class.risk-login-menu-flex-column": "this.isColumn" } }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:flex!important}:host.risk-login-menu-flex-row{flex-direction:row}:host.risk-login-menu-flex-column{flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.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: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
65
+ }
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponent, decorators: [{
67
+ type: Component,
68
+ args: [{ selector: 'risk-login-menu', host: {
69
+ '[class.risk-login-menu]': 'true'
70
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:flex!important}:host.risk-login-menu-flex-row{flex-direction:row}:host.risk-login-menu-flex-column{flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"] }]
71
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
72
+ type: Inject,
73
+ args: [AUTH_PROVIDER]
74
+ }] }, { type: i1.AuthRoutingFlowService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { orientation: [{
75
+ type: Input
76
+ }], isRow: [{
77
+ type: HostBinding,
78
+ args: ['class.risk-login-menu-flex-row']
79
+ }], isColumn: [{
80
+ type: HostBinding,
81
+ args: ['class.risk-login-menu-flex-column']
82
+ }] } });
83
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4ubWVudS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wa2cvZGJnLXJpc2tpdC9hbmd1bGFyLWxvZ2luL3NyYy9saWIvbG9naW4ubWVudS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wa2cvZGJnLXJpc2tpdC9hbmd1bGFyLWxvZ2luL3NyYy9saWIvbG9naW4ubWVudS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0gsdUJBQXVCLEVBRXZCLFNBQVMsRUFDVCxTQUFTLEVBQ1QsV0FBVyxFQUNYLE1BQU0sRUFDTixLQUFLLEVBQ1IsTUFBTSxlQUFlLENBQUM7QUFHdkIsT0FBTyxFQUFDLGFBQWEsRUFBQyxNQUFNLDRCQUE0QixDQUFDO0FBQ3pELE9BQU8sRUFBQyxhQUFhLEV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gIHRoaXMuYXV0aFJvdXRpbmdGbG93U2VydmljZS5sb2dvdXQoKS5waXBlKFxuICAgICAgICAgICAgZmlyc3QoKVxuICAgICAgICApLnN1YnNjcmliZSgpO1xuICAgIH1cbn1cbiIsIjxuZy10ZW1wbGF0ZSBbbmdJZl09XCJvcmllbnRhdGlvbiA9PT0gJ3JvdydcIj5cbiAgICA8bWF0LW1lbnUgI2xvZ2luTWVudT1cIm1hdE1lbnVcIlxuICAgICAgICAgICAgICBbb3ZlcmxhcFRyaWdnZXJdPVwiZmFsc2VcIj5cbiAgICAgICAgPG5nLWNvbnRlbnQgc2VsZWN0PVwicmlzay1sb2dpbi1tZW51LWJlZm9yZS1pdGVtcy1ob3Jpem9udGFsXCI+PC9uZy1jb250ZW50PlxuICAgICAgICA8bmctdGVtcGxhdGUgW25nSWZdPVwiYXV0aFN0YXR1cyB8IGFzeW5jXCIgW25nSWZFbHNlXT1cImxvZ2dlZE91dFwiPlxuICAgICAgICAgICAgPGJ1dHRvbiBtYXQtbWVudS1pdGVtXG4gICAgICAgICAgICAgICAgICAgIChjbGljayk9XCJsb2dvdXQoKVwiXG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIj5cbiAgICAgICAgICAgICAgICA8bWF0LWljb24+ZXhpdF90b19hcHA8L21hdC1pY29uPlxuICAgICAgICAgICAgICAgIExvZ291dFxuICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgIDwvbmctdGVtcGxhdGU+XG4gICAgICAgIDxuZy10ZW1wbGF0ZSAjbG9nZ2VkT3V0PlxuICAgICAgICAgICAgPGJ1dHRvbiBtYXQtbWVudS1pdGVtXG4gICAgICAgICAgICAgICAgICAgIChjbGljayk9XCJsb2dvdXQoKVwiXG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJidXR0b25cIj5cbiAgICAgICAgICAgICAgICA8bWF0LWljb24+bGF1bmNoPC9tYXQtaWNvbj5cbiAgICAgICAgICAgICAgICBMb2dpblxuICAgICAgICA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AgICAoY2xpY2spPVwibG9nb3V0KClcIj5cbiAgICAgICAgICAgIDxtYXQtaWNvbj5leGl0X3RvX2FwcDwvbWF0LWljb24+XG4gICAgICAgICAgICBMb2dvdXRcbiAgICAgICAgPC9hPlxuICAgIDwvbmctdGVtcGxhdGU+XG4gICAgPG5nLXRlbXBsYXRlICNsb2dnZWRPdXQyPlxuICAgICAgICA8YSBtYXQtYnV0dG9uXG4gICAgICAgICAgIChjbGljayk9XCJsb2dvdXQoKVwiPlxuICAgICAgICAgICAgPG1hdC1pY29uPmxhdW5jaDwvbWF0LWljb24+XG4gICAgICAgICAgICBMb2dpblxuICAgICAgICA8L2E+XG4gICAgPC9uZy10ZW1wbGF0ZT5cbiAgICA8bmctY29udGVudCBzZWxlY3Q9XCJyaXNrLWxvZ2luLW1lbnUtYWZ0ZXItaXRlbXMtdmVydGljYWxcIj48L25nLWNvbnRlbnQ+XG48L25nLXRlbXBsYXRlPlxuIl19
@@ -0,0 +1,51 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { FormsModule } from '@angular/forms';
4
+ import { RouterModule } from '@angular/router';
5
+ import { AuthModule } from '@dbg-riskit/angular-auth';
6
+ import { CommonViewModule } from '@dbg-riskit/angular-view';
7
+ import { LoginComponent } from './login.component';
8
+ import { LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective } from './login.menu.component';
9
+ import * as i0 from "@angular/core";
10
+ export class LoginModule {
11
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
12
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
13
+ LoginComponent,
14
+ LoginMenuComponentTitleDirective,
15
+ LoginMenuItemsDirective], imports: [CommonModule,
16
+ FormsModule,
17
+ RouterModule,
18
+ AuthModule,
19
+ CommonViewModule], exports: [LoginMenuComponent,
20
+ LoginMenuComponentTitleDirective,
21
+ LoginMenuItemsDirective] }); }
22
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, imports: [CommonModule,
23
+ FormsModule,
24
+ RouterModule,
25
+ AuthModule,
26
+ CommonViewModule] }); }
27
+ }
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, decorators: [{
29
+ type: NgModule,
30
+ args: [{
31
+ imports: [
32
+ CommonModule,
33
+ FormsModule,
34
+ RouterModule,
35
+ AuthModule,
36
+ CommonViewModule
37
+ ],
38
+ declarations: [
39
+ LoginMenuComponent,
40
+ LoginComponent,
41
+ LoginMenuComponentTitleDirective,
42
+ LoginMenuItemsDirective
43
+ ],
44
+ exports: [
45
+ LoginMenuComponent,
46
+ LoginMenuComponentTitleDirective,
47
+ LoginMenuItemsDirective
48
+ ]
49
+ }]
50
+ }] });
51
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9naW4ubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGtnL2RiZy1yaXNraXQvYW5ndWxhci1sb2dpbi9zcmMvbGliL2xvZ2luLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFDLFFBQVEsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUN2QyxPQUFPLEVBQUMsV0FBVyxFQUFDLE1BQU0sZ0JBQWdCLENBQUM7QUFDM0MsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGlCQUFpQixDQUFDO0FBQzdDLE9BQU8sRUFBQyxVQUFVLEVB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pXG5leHBvcnQgY2xhc3MgTG9naW5Nb2R1bGUge1xufVxuIl19
@@ -0,0 +1,207 @@
1
+ import * as i2 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, ChangeDetectionStrategy, Inject, Directive, Input, HostBinding, NgModule } from '@angular/core';
5
+ import * as i3 from '@angular/forms';
6
+ import { FormsModule } from '@angular/forms';
7
+ import { RouterModule } from '@angular/router';
8
+ import * as i1 from '@dbg-riskit/angular-auth';
9
+ import { AuthModule } from '@dbg-riskit/angular-auth';
10
+ import * as i4 from '@dbg-riskit/angular-view';
11
+ import { BaseComponent, CommonViewModule } from '@dbg-riskit/angular-view';
12
+ import { AUTH_PROVIDER, SECONDARY_LOGO } from '@dbg-riskit/angular-common';
13
+ import { toErrorMessage } from '@dbg-riskit/angular-error';
14
+ import { takeUntil, first } from 'rxjs/operators';
15
+ import * as i3$1 from '@angular/material/button';
16
+ import * as i6 from '@angular/material/card';
17
+ import * as i7 from '@angular/material/form-field';
18
+ import * as i8 from '@angular/material/icon';
19
+ import * as i9 from '@angular/material/input';
20
+ import * as i10 from '@angular/material/progress-spinner';
21
+ import * as i5 from '@angular/material/menu';
22
+
23
+ class LoginComponent extends BaseComponent {
24
+ constructor(authProvider, changeDetectorRef, authRoutingFlowService, secondaryLogo) {
25
+ super();
26
+ this.authProvider = authProvider;
27
+ this.changeDetectorRef = changeDetectorRef;
28
+ this.authRoutingFlowService = authRoutingFlowService;
29
+ this.secondaryLogo = secondaryLogo;
30
+ /**
31
+ * Control for "login button-to-spinner".
32
+ */
33
+ this.loggingIn = false;
34
+ // Update component state on login status change
35
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
36
+ }
37
+ ngAfterViewInit() {
38
+ this.authRoutingFlowService.loginViaService().pipe(takeUntil(this.destroyed)).subscribe(() => {
39
+ this.changeDetectorRef.markForCheck();
40
+ }, (err) => {
41
+ this.errorMessage = toErrorMessage(err).message;
42
+ this.changeDetectorRef.markForCheck();
43
+ });
44
+ }
45
+ get isDirectFlow() {
46
+ return this.authRoutingFlowService.directFlow;
47
+ }
48
+ get authStatus() {
49
+ return this.authProvider.loggedIn;
50
+ }
51
+ get userProfile() {
52
+ return this.authProvider.userProfile;
53
+ }
54
+ login() {
55
+ this.loggingIn = true;
56
+ this.authRoutingFlowService.login(this.username, this.password).pipe(first()).subscribe((res) => {
57
+ if (!res) {
58
+ this.errorMessage = 'Authentication failed. Server did not generate a token.';
59
+ }
60
+ this.loggingIn = false;
61
+ this.changeDetectorRef.markForCheck();
62
+ }, () => {
63
+ this.loggingIn = false;
64
+ this.errorMessage = 'Authentication failed. Is the username and password correct?';
65
+ this.changeDetectorRef.markForCheck();
66
+ });
67
+ }
68
+ get logo() {
69
+ return this.secondaryLogo;
70
+ }
71
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component }); }
72
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoginComponent, selector: "ng-component", host: { properties: { "class.risk-login-form": "true" } }, usesInheritance: true, ngImport: i0, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-header>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n <risk-flex-spacer></risk-flex-spacer>\n <img [src]=\"logo\" alt=\"Company logo\">\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-mdc-card-actions img{margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:flex}.risk-login-form-flex-wrapper>div{flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { kind: "component", type: i3$1.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.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i6.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i6.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i6.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i6.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i9.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: "component", type: i4.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { kind: "component", type: i4.FlexSpacerComponent, selector: "risk-flex-spacer" }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
73
+ }
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginComponent, decorators: [{
75
+ type: Component,
76
+ args: [{ host: {
77
+ '[class.risk-login-form]': 'true'
78
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-header>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-header>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n <risk-flex-spacer></risk-flex-spacer>\n <img [src]=\"logo\" alt=\"Company logo\">\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-mdc-card-actions img{margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:flex}.risk-login-form-flex-wrapper>div{flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"] }]
79
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
80
+ type: Inject,
81
+ args: [AUTH_PROVIDER]
82
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.AuthRoutingFlowService }, { type: undefined, decorators: [{
83
+ type: Inject,
84
+ args: [SECONDARY_LOGO]
85
+ }] }]; } });
86
+
87
+ class LoginMenuComponentTitleDirective {
88
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
89
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 }); }
90
+ }
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponentTitleDirective, decorators: [{
92
+ type: Directive,
93
+ args: [{
94
+ selector: 'risk-login-menu-title-horizontal, '
95
+ + 'risk-login-menu-title-vertical',
96
+ host: {
97
+ '[class.risk-login-menu-title]': 'true'
98
+ }
99
+ }]
100
+ }] });
101
+ class LoginMenuItemsDirective {
102
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
103
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuItemsDirective, selector: "risk-login-menu-before-items-horizontal, risk-login-menu-before-items-vertical,risk-login-menu-after-items-horizontal,risk-login-menu-after-items-vertical", ngImport: i0 }); }
104
+ }
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuItemsDirective, decorators: [{
106
+ type: Directive,
107
+ args: [{
108
+ selector: 'risk-login-menu-before-items-horizontal,'
109
+ + ' risk-login-menu-before-items-vertical,'
110
+ + 'risk-login-menu-after-items-horizontal,'
111
+ + 'risk-login-menu-after-items-vertical'
112
+ }]
113
+ }] });
114
+ class LoginMenuComponent extends BaseComponent {
115
+ get isRow() {
116
+ return this.orientation === 'row';
117
+ }
118
+ get isColumn() {
119
+ return this.orientation === 'column';
120
+ }
121
+ constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
122
+ super();
123
+ this.authProvider = authProvider;
124
+ this.authRoutingFlowService = authRoutingFlowService;
125
+ this.changeDetectorRef = changeDetectorRef;
126
+ this.orientation = 'row';
127
+ // Update menu state on login status change
128
+ this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
129
+ }
130
+ menuClosed() {
131
+ this.changeDetectorRef.markForCheck();
132
+ }
133
+ get authStatus() {
134
+ return this.authProvider.loggedIn;
135
+ }
136
+ logout() {
137
+ this.authRoutingFlowService.logout().pipe(first()).subscribe();
138
+ }
139
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
140
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoginMenuComponent, selector: "risk-login-menu", inputs: { orientation: "orientation" }, host: { properties: { "class.risk-login-menu": "true", "class.risk-login-menu-flex-row": "this.isRow", "class.risk-login-menu-flex-column": "this.isColumn" } }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:flex!important}:host.risk-login-menu-flex-row{flex-direction:row}:host.risk-login-menu-flex-column{flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$1.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: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
141
+ }
142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginMenuComponent, decorators: [{
143
+ type: Component,
144
+ args: [{ selector: 'risk-login-menu', host: {
145
+ '[class.risk-login-menu]': 'true'
146
+ }, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:flex!important}:host.risk-login-menu-flex-row{flex-direction:row}:host.risk-login-menu-flex-column{flex-direction:column}:host .risk-login-menu-title{font-weight:700;margin:0 5px}\n"] }]
147
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
148
+ type: Inject,
149
+ args: [AUTH_PROVIDER]
150
+ }] }, { type: i1.AuthRoutingFlowService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { orientation: [{
151
+ type: Input
152
+ }], isRow: [{
153
+ type: HostBinding,
154
+ args: ['class.risk-login-menu-flex-row']
155
+ }], isColumn: [{
156
+ type: HostBinding,
157
+ args: ['class.risk-login-menu-flex-column']
158
+ }] } });
159
+
160
+ class LoginModule {
161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
162
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
163
+ LoginComponent,
164
+ LoginMenuComponentTitleDirective,
165
+ LoginMenuItemsDirective], imports: [CommonModule,
166
+ FormsModule,
167
+ RouterModule,
168
+ AuthModule,
169
+ CommonViewModule], exports: [LoginMenuComponent,
170
+ LoginMenuComponentTitleDirective,
171
+ LoginMenuItemsDirective] }); }
172
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, imports: [CommonModule,
173
+ FormsModule,
174
+ RouterModule,
175
+ AuthModule,
176
+ CommonViewModule] }); }
177
+ }
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoginModule, decorators: [{
179
+ type: NgModule,
180
+ args: [{
181
+ imports: [
182
+ CommonModule,
183
+ FormsModule,
184
+ RouterModule,
185
+ AuthModule,
186
+ CommonViewModule
187
+ ],
188
+ declarations: [
189
+ LoginMenuComponent,
190
+ LoginComponent,
191
+ LoginMenuComponentTitleDirective,
192
+ LoginMenuItemsDirective
193
+ ],
194
+ exports: [
195
+ LoginMenuComponent,
196
+ LoginMenuComponentTitleDirective,
197
+ LoginMenuItemsDirective
198
+ ]
199
+ }]
200
+ }] });
201
+
202
+ /**
203
+ * Generated bundle index. Do not edit.
204
+ */
205
+
206
+ export { LoginComponent, LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective, LoginModule };
207
+ //# sourceMappingURL=dbg-riskit-angular-login.mjs.map