@cleavelandprice/ngx-lib 4.7.15 → 4.8.0

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.
@@ -142,7 +142,7 @@ class LoginFormComponent {
142
142
  }
143
143
  }
144
144
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: LoginFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
145
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: LoginFormComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<h2 mat-dialog-title>\r\n @if (services.authentication.authenticating) {\r\n <span>Authenticating...</span>\r\n } @else {\r\n <span>Login</span>\r\n }\r\n</h2>\r\n\r\n<mat-dialog-content>\r\n @if (services.authentication.authenticating) {\r\n <div id=\"spinner\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\r\n </div>\r\n } @else if (errorMessage) {\r\n <div id=\"error\">\r\n {{ errorMessage }}\r\n </div>\r\n } @else {\r\n <form [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n @if (services.authentication.options.showRememberMeOption) {\r\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\r\n Remember me next time\r\n </mat-slide-toggle>\r\n }\r\n </form>\r\n }\r\n</mat-dialog-content>\r\n\r\n@if (!services.authentication.authenticating) {\r\n <mat-dialog-actions>\r\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\r\n [disabled]=\"form.invalid\">\r\n <mat-icon fontIcon=\"done\"/>\r\n <span>OK</span>\r\n </button>\r\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\r\n <mat-icon fontIcon=\"close\"/>\r\n <span>Cancel</span>\r\n </button>\r\n </mat-dialog-actions>\r\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "fullWidth", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
145
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: LoginFormComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<h2 mat-dialog-title>\n @if (services.authentication.authenticating) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n <form [formGroup]=\"form\">\n <mat-form-field>\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form.invalid\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "fullWidth", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
146
146
  }
147
147
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: LoginFormComponent, decorators: [{
148
148
  type: Component,
@@ -156,7 +156,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
156
156
  MatProgressSpinner,
157
157
  MatSlideToggle,
158
158
  ReactiveFormsModule,
159
- ], standalone: true, changeDetection: ChangeDetectionStrategy.Eager, template: "<h2 mat-dialog-title>\r\n @if (services.authentication.authenticating) {\r\n <span>Authenticating...</span>\r\n } @else {\r\n <span>Login</span>\r\n }\r\n</h2>\r\n\r\n<mat-dialog-content>\r\n @if (services.authentication.authenticating) {\r\n <div id=\"spinner\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\r\n </div>\r\n } @else if (errorMessage) {\r\n <div id=\"error\">\r\n {{ errorMessage }}\r\n </div>\r\n } @else {\r\n <form [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n @if (services.authentication.options.showRememberMeOption) {\r\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\r\n Remember me next time\r\n </mat-slide-toggle>\r\n }\r\n </form>\r\n }\r\n</mat-dialog-content>\r\n\r\n@if (!services.authentication.authenticating) {\r\n <mat-dialog-actions>\r\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\r\n [disabled]=\"form.invalid\">\r\n <mat-icon fontIcon=\"done\"/>\r\n <span>OK</span>\r\n </button>\r\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\r\n <mat-icon fontIcon=\"close\"/>\r\n <span>Cancel</span>\r\n </button>\r\n </mat-dialog-actions>\r\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
159
+ ], standalone: true, changeDetection: ChangeDetectionStrategy.Eager, template: "<h2 mat-dialog-title>\n @if (services.authentication.authenticating) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n <form [formGroup]=\"form\">\n <mat-form-field>\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form.invalid\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
160
160
  }] });
161
161
 
162
162
  class LoginComponent {
@@ -195,11 +195,11 @@ class LoginComponent {
195
195
  });
196
196
  }
197
197
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: LoginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
198
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: LoginComponent, isStandalone: true, selector: "cp-login", inputs: { adminGroup: { classPropertyName: "adminGroup", publicName: "adminGroup", isSignal: true, isRequired: false, transformFunction: null }, additionalInfo: { classPropertyName: "additionalInfo", publicName: "additionalInfo", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div id=\"user-id\">\r\n <!-- Logged out -->\r\n <!-- Logged in -->\r\n @if (services.authentication.authenticated) {\r\n <!-- With photo -->\r\n @if (services.authentication.authenticatedUser?.photoUrl) {\r\n <img\r\n id=\"authenticated-user-image\"\r\n [src]=\"\r\n $safeNavigationMigration(\r\n services.authentication.authenticatedUser?.photoUrl\r\n )\r\n \"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"\r\n />\r\n } @else {\r\n <!-- Without photo -->\r\n <mat-icon\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"\r\n >\r\n </mat-icon>\r\n }\r\n <!-- Name -->\r\n <div id=\"user-name\">\r\n {{ services.authentication.authenticatedUser?.displayName }}\r\n </div>\r\n } @else {\r\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\r\n </mat-icon>\r\n }\r\n</div>\r\n", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
198
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: LoginComponent, isStandalone: true, selector: "cp-login", inputs: { adminGroup: { classPropertyName: "adminGroup", publicName: "adminGroup", isSignal: true, isRequired: false, transformFunction: null }, additionalInfo: { classPropertyName: "additionalInfo", publicName: "additionalInfo", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"\n $safeNavigationMigration(\n services.authentication.authenticatedUser?.photoUrl\n )\n \"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n >\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser?.displayName }}\n </div>\n } @else {\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\n </mat-icon>\n }\n</div>\n", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
199
199
  }
200
200
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: LoginComponent, decorators: [{
201
201
  type: Component,
202
- args: [{ selector: 'cp-login', imports: [MatIcon], standalone: true, changeDetection: ChangeDetectionStrategy.Eager, template: "<div id=\"user-id\">\r\n <!-- Logged out -->\r\n <!-- Logged in -->\r\n @if (services.authentication.authenticated) {\r\n <!-- With photo -->\r\n @if (services.authentication.authenticatedUser?.photoUrl) {\r\n <img\r\n id=\"authenticated-user-image\"\r\n [src]=\"\r\n $safeNavigationMigration(\r\n services.authentication.authenticatedUser?.photoUrl\r\n )\r\n \"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"\r\n />\r\n } @else {\r\n <!-- Without photo -->\r\n <mat-icon\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"\r\n >\r\n </mat-icon>\r\n }\r\n <!-- Name -->\r\n <div id=\"user-name\">\r\n {{ services.authentication.authenticatedUser?.displayName }}\r\n </div>\r\n } @else {\r\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\r\n </mat-icon>\r\n }\r\n</div>\r\n", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
202
+ args: [{ selector: 'cp-login', imports: [MatIcon], standalone: true, changeDetection: ChangeDetectionStrategy.Eager, template: "<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"\n $safeNavigationMigration(\n services.authentication.authenticatedUser?.photoUrl\n )\n \"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n >\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser?.displayName }}\n </div>\n } @else {\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\n </mat-icon>\n }\n</div>\n", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
203
203
  }], propDecorators: { adminGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "adminGroup", required: false }] }], additionalInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "additionalInfo", required: false }] }] } });
204
204
 
205
205
  class MatAuthenticationModule {
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-authentication-material.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/model/mat-authentication-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/services/mat-authentication.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/mat-authentication.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/cleavelandprice-ngx-lib-authentication-material.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { MatAuthenticationServiceOptions } from \"./mat-authentication-service-options\";\r\n\r\nexport const MatAuthenticationServiceOptionsToken = new InjectionToken<MatAuthenticationServiceOptions>('');","import { Inject, inject, Injectable, Optional } from '@angular/core';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport { SharePointService } from '@cleavelandprice/ngx-lib/sharepoint';\r\n\r\nimport {\r\n AuthenticationToken,\r\n AuthenticationTokenService\r\n} from '@cleavelandprice/ngx-lib/authentication/token';\r\nimport { MatAuthenticationServiceOptions } from '../model/mat-authentication-service-options';\r\nimport { MatAuthenticationServiceOptionsToken } from '../model/mat-authentication-service-options-token';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class MatAuthenticationService extends AuthenticationTokenService {\r\n #sharePointService = inject(SharePointService);\r\n\r\n override options!: MatAuthenticationServiceOptions;\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(MatAuthenticationServiceOptionsToken) constructorOptions: MatAuthenticationServiceOptions) {\r\n super({...constructorOptions, deferTokenValidation: true});\r\n\r\n // When super() was called, the parent class defined the 'options' object with all of the other properties\r\n this.options = { ...this.options, ...constructorOptions };\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n override validateUser(token: string): void {\r\n const jwtHelper = new JwtHelperService();\r\n const decoded = jwtHelper.decodeToken(token) as AuthenticationToken;\r\n\r\n if (jwtHelper.isTokenExpired(token)) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n this.authenticatedUser = {\r\n accountName: decoded.winaccountname,\r\n admin: decoded.role === 'Admin',\r\n department: decoded.department,\r\n displayName: decoded.displayName,\r\n distinguishedName: decoded.distinguishedName,\r\n email: decoded.email,\r\n employeeNumber: decoded.employeeNumber,\r\n firstName: decoded.firstName,\r\n hireDate: decoded.hireDate,\r\n lastName: decoded.lastName,\r\n manager: decoded.manager,\r\n memberOf: decoded.memberOf,\r\n phone: decoded.phone,\r\n photoUrl: undefined,\r\n sid: decoded.sid,\r\n title: decoded.title,\r\n workShift: decoded.workShift\r\n };\r\n\r\n this.storage.setItem(this.options.tokenName!, token);\r\n\r\n this.#getPhoto();\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n #getPhoto(): void {\r\n this.#sharePointService.getPhotos()\r\n .subscribe(photos => {\r\n // The user may have been logged out by the time the photos came back\r\n if (!this.authenticatedUser?.employeeNumber) {\r\n return;\r\n }\r\n\r\n const photo = this.authenticatedUser!.employeeNumber && photos.find(pic => pic.employeeNumber === +this.authenticatedUser!.employeeNumber!);\r\n\r\n if (photo) {\r\n this.authenticatedUser.photoUrl = photo.encodedAbsUrl;\r\n }\r\n });\r\n }\r\n //#endregion\r\n}","import {\r\n Component,\r\n inject,\r\n OnDestroy,\r\n OnInit,\r\n OutputRefSubscription,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n ReactiveFormsModule,\r\n Validators,\r\n} from '@angular/forms';\r\nimport {\r\n MAT_DIALOG_DATA,\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n} from '@angular/material/dialog';\r\n\r\nimport { MatButton } from '@angular/material/button';\r\nimport { MatFormField } from '@angular/material/form-field';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\r\nimport { LoginFormData } from '../../model/login-form-data';\r\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\r\n\r\n@Component({\r\n templateUrl: './login-form.component.html',\r\n imports: [\r\n MatButton,\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatFormField,\r\n MatIcon,\r\n MatInput,\r\n MatProgressSpinner,\r\n MatSlideToggle,\r\n ReactiveFormsModule,\r\n ],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n styleUrls: [\r\n './login-form.component.scss',\r\n '../../../../../styles/mat-icon.scss',\r\n ],\r\n})\r\nexport class LoginFormComponent implements OnInit, OnDestroy {\r\n #data = inject<LoginFormData>(MAT_DIALOG_DATA);\r\n\r\n services = {\r\n dialogRef: inject(MatDialogRef<LoginFormComponent>),\r\n authentication: inject(MatAuthenticationService),\r\n };\r\n\r\n errorMessage?: string;\r\n authenticatedChangedSubscription!: OutputRefSubscription;\r\n authenticationErrorSubscription!: OutputRefSubscription;\r\n\r\n form = new FormGroup({\r\n username: new FormControl(null, [Validators.required]),\r\n password: new FormControl(null, [Validators.required]),\r\n adminGroup: new FormControl(),\r\n additionalInfo: new FormControl(),\r\n });\r\n\r\n ngOnInit(): void {\r\n this.form.get('adminGroup')?.setValue(this.#data.adminGroup);\r\n this.form.get('additionalInfo')?.setValue(this.#data.additionalInfo);\r\n\r\n this.authenticatedChangedSubscription =\r\n this.services.authentication.authenticatedChanged.subscribe(\r\n this.#authChangedHandler.bind(this),\r\n );\r\n\r\n this.authenticationErrorSubscription =\r\n this.services.authentication.authenticationError.subscribe(\r\n this.#errorHandler.bind(this),\r\n );\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.authenticationErrorSubscription.unsubscribe();\r\n this.authenticatedChangedSubscription.unsubscribe();\r\n }\r\n\r\n authenticate() {\r\n this.errorMessage = undefined;\r\n const { username, password, adminGroup, additionalInfo } = this.form.value;\r\n this.services.authentication.login(\r\n username!,\r\n password!,\r\n adminGroup,\r\n additionalInfo,\r\n );\r\n }\r\n\r\n #authChangedHandler(authenticated: boolean): void {\r\n if (authenticated) {\r\n this.services.dialogRef.close();\r\n }\r\n }\r\n\r\n #errorHandler(err: any): void {\r\n console.log('Authentication error', err);\r\n this.errorMessage = `${err.name}: ${err.statusText}`;\r\n }\r\n\r\n changeTokenStorageMode(checked: boolean): void {\r\n const keyName = 'storeTokenInSession';\r\n\r\n if (checked) {\r\n if (localStorage.getItem(keyName)) {\r\n localStorage.removeItem(keyName);\r\n }\r\n } else {\r\n localStorage.setItem(keyName, 'true');\r\n }\r\n }\r\n}\r\n","<h2 mat-dialog-title>\r\n @if (services.authentication.authenticating) {\r\n <span>Authenticating...</span>\r\n } @else {\r\n <span>Login</span>\r\n }\r\n</h2>\r\n\r\n<mat-dialog-content>\r\n @if (services.authentication.authenticating) {\r\n <div id=\"spinner\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\r\n </div>\r\n } @else if (errorMessage) {\r\n <div id=\"error\">\r\n {{ errorMessage }}\r\n </div>\r\n } @else {\r\n <form [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n @if (services.authentication.options.showRememberMeOption) {\r\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\r\n Remember me next time\r\n </mat-slide-toggle>\r\n }\r\n </form>\r\n }\r\n</mat-dialog-content>\r\n\r\n@if (!services.authentication.authenticating) {\r\n <mat-dialog-actions>\r\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\r\n [disabled]=\"form.invalid\">\r\n <mat-icon fontIcon=\"done\"/>\r\n <span>OK</span>\r\n </button>\r\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\r\n <mat-icon fontIcon=\"close\"/>\r\n <span>Cancel</span>\r\n </button>\r\n </mat-dialog-actions>\r\n}","import {\r\n Component,\r\n inject,\r\n input,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\nimport { MatDialog } from '@angular/material/dialog';\r\nimport { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';\r\n\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\r\nimport { LoginFormComponent } from '../login-form/login-form.component';\r\n\r\n@Component({\r\n selector: 'cp-login',\r\n imports: [MatIcon],\r\n standalone: true,\r\n templateUrl: './login.component.html',\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n styleUrls: ['./login.component.scss', '../../../../../styles/mat-icon.scss'],\r\n})\r\nexport class LoginComponent {\r\n #services = {\r\n dialog: inject(MatDialog),\r\n };\r\n services = {\r\n authentication: inject(MatAuthenticationService),\r\n };\r\n //#endregion\r\n\r\n adminGroup = input<string>();\r\n additionalInfo = input<string>();\r\n\r\n login(): void {\r\n this.#services.dialog.open(LoginFormComponent, {\r\n data: {\r\n adminGroup: this.adminGroup(),\r\n additionalInfo: this.additionalInfo(),\r\n },\r\n });\r\n }\r\n\r\n confirmLogout(): void {\r\n this.#services.dialog\r\n .open(ConfirmationComponent, {\r\n data: { message: `Are you sure you want to logout?` },\r\n })\r\n .afterClosed()\r\n .subscribe((result) => {\r\n if (result) {\r\n this.services.authentication.logout();\r\n }\r\n });\r\n }\r\n}\r\n","<div id=\"user-id\">\r\n <!-- Logged out -->\r\n <!-- Logged in -->\r\n @if (services.authentication.authenticated) {\r\n <!-- With photo -->\r\n @if (services.authentication.authenticatedUser?.photoUrl) {\r\n <img\r\n id=\"authenticated-user-image\"\r\n [src]=\"\r\n $safeNavigationMigration(\r\n services.authentication.authenticatedUser?.photoUrl\r\n )\r\n \"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"\r\n />\r\n } @else {\r\n <!-- Without photo -->\r\n <mat-icon\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"\r\n >\r\n </mat-icon>\r\n }\r\n <!-- Name -->\r\n <div id=\"user-name\">\r\n {{ services.authentication.authenticatedUser?.displayName }}\r\n </div>\r\n } @else {\r\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\r\n </mat-icon>\r\n }\r\n</div>\r\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\n\r\nimport { MatAuthenticationServiceOptions } from './model/mat-authentication-service-options';\r\n\r\n\r\nimport { LoginFormComponent } from './components/login-form/login-form.component';\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { MatAuthenticationServiceOptionsToken } from './model/mat-authentication-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n \r\n MatButtonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatProgressSpinnerModule,\r\n MatSlideToggleModule,\r\n\r\n LoginComponent,\r\n LoginFormComponent\r\n ],\r\n exports: [\r\n LoginComponent,\r\n LoginFormComponent\r\n ]\r\n})\r\nexport class MatAuthenticationModule {\r\n static forRoot(options: MatAuthenticationServiceOptions): ModuleWithProviders<MatAuthenticationModule> {\r\n return {\r\n ngModule: MatAuthenticationModule,\r\n providers: [\r\n {\r\n provide: MatAuthenticationServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: MatAuthenticationModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'MatAuthenticationModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './mat-authentication.api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAGa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,EAAE;;ACYpG,MAAO,wBAAyB,SAAQ,0BAA0B,CAAA;AACtE,IAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC;;AAK9C,IAAA,WAAA,CAAsE,kBAAmD,EAAA;QACvH,KAAK,CAAC,EAAC,GAAG,kBAAkB,EAAE,oBAAoB,EAAE,IAAI,EAAC,CAAC;;AAG1D,QAAA,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EA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":["../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/model/mat-authentication-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/services/mat-authentication.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/mat-authentication.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/cleavelandprice-ngx-lib-authentication-material.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { MatAuthenticationServiceOptions } from \"./mat-authentication-service-options\";\r\n\r\nexport const MatAuthenticationServiceOptionsToken = new InjectionToken<MatAuthenticationServiceOptions>('');","import { Inject, inject, Injectable, Optional } from '@angular/core';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport { SharePointService } from '@cleavelandprice/ngx-lib/sharepoint';\r\n\r\nimport {\r\n AuthenticationToken,\r\n AuthenticationTokenService\r\n} from '@cleavelandprice/ngx-lib/authentication/token';\r\nimport { MatAuthenticationServiceOptions } from '../model/mat-authentication-service-options';\r\nimport { MatAuthenticationServiceOptionsToken } from '../model/mat-authentication-service-options-token';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class MatAuthenticationService extends AuthenticationTokenService {\r\n #sharePointService = inject(SharePointService);\r\n\r\n override options!: MatAuthenticationServiceOptions;\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(MatAuthenticationServiceOptionsToken) constructorOptions: MatAuthenticationServiceOptions) {\r\n super({...constructorOptions, deferTokenValidation: true});\r\n\r\n // When super() was called, the parent class defined the 'options' object with all of the other properties\r\n this.options = { ...this.options, ...constructorOptions };\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n override validateUser(token: string): void {\r\n const jwtHelper = new JwtHelperService();\r\n const decoded = jwtHelper.decodeToken(token) as AuthenticationToken;\r\n\r\n if (jwtHelper.isTokenExpired(token)) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n this.authenticatedUser = {\r\n accountName: decoded.winaccountname,\r\n admin: decoded.role === 'Admin',\r\n department: decoded.department,\r\n displayName: decoded.displayName,\r\n distinguishedName: decoded.distinguishedName,\r\n email: decoded.email,\r\n employeeNumber: decoded.employeeNumber,\r\n firstName: decoded.firstName,\r\n hireDate: decoded.hireDate,\r\n lastName: decoded.lastName,\r\n manager: decoded.manager,\r\n memberOf: decoded.memberOf,\r\n phone: decoded.phone,\r\n photoUrl: undefined,\r\n sid: decoded.sid,\r\n title: decoded.title,\r\n workShift: decoded.workShift\r\n };\r\n\r\n this.storage.setItem(this.options.tokenName!, token);\r\n\r\n this.#getPhoto();\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n #getPhoto(): void {\r\n this.#sharePointService.getPhotos()\r\n .subscribe(photos => {\r\n // The user may have been logged out by the time the photos came back\r\n if (!this.authenticatedUser?.employeeNumber) {\r\n return;\r\n }\r\n\r\n const photo = this.authenticatedUser!.employeeNumber && photos.find(pic => pic.employeeNumber === +this.authenticatedUser!.employeeNumber!);\r\n\r\n if (photo) {\r\n this.authenticatedUser.photoUrl = photo.encodedAbsUrl;\r\n }\r\n });\r\n }\r\n //#endregion\r\n}","import {\n Component,\n inject,\n OnDestroy,\n OnInit,\n OutputRefSubscription,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n ReactiveFormsModule,\n Validators,\n} from '@angular/forms';\nimport {\n MAT_DIALOG_DATA,\n MatDialogActions,\n MatDialogContent,\n MatDialogRef,\n} from '@angular/material/dialog';\n\nimport { MatButton } from '@angular/material/button';\nimport { MatFormField } from '@angular/material/form-field';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatInput } from '@angular/material/input';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\nimport { LoginFormData } from '../../model/login-form-data';\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\n\n@Component({\n templateUrl: './login-form.component.html',\n imports: [\n MatButton,\n MatDialogActions,\n MatDialogContent,\n MatFormField,\n MatIcon,\n MatInput,\n MatProgressSpinner,\n MatSlideToggle,\n ReactiveFormsModule,\n ],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrls: [\n './login-form.component.scss',\n '../../../../../styles/mat-icon.scss',\n ],\n})\nexport class LoginFormComponent implements OnInit, OnDestroy {\n #data = inject<LoginFormData>(MAT_DIALOG_DATA);\n\n services = {\n dialogRef: inject(MatDialogRef<LoginFormComponent>),\n authentication: inject(MatAuthenticationService),\n };\n\n errorMessage?: string;\n authenticatedChangedSubscription!: OutputRefSubscription;\n authenticationErrorSubscription!: OutputRefSubscription;\n\n form = new FormGroup({\n username: new FormControl(null, [Validators.required]),\n password: new FormControl(null, [Validators.required]),\n adminGroup: new FormControl(),\n additionalInfo: new FormControl(),\n });\n\n ngOnInit(): void {\n this.form.get('adminGroup')?.setValue(this.#data.adminGroup);\n this.form.get('additionalInfo')?.setValue(this.#data.additionalInfo);\n\n this.authenticatedChangedSubscription =\n this.services.authentication.authenticatedChanged.subscribe(\n this.#authChangedHandler.bind(this),\n );\n\n this.authenticationErrorSubscription =\n this.services.authentication.authenticationError.subscribe(\n this.#errorHandler.bind(this),\n );\n }\n\n ngOnDestroy(): void {\n this.authenticationErrorSubscription.unsubscribe();\n this.authenticatedChangedSubscription.unsubscribe();\n }\n\n authenticate() {\n this.errorMessage = undefined;\n const { username, password, adminGroup, additionalInfo } = this.form.value;\n this.services.authentication.login(\n username!,\n password!,\n adminGroup,\n additionalInfo,\n );\n }\n\n #authChangedHandler(authenticated: boolean): void {\n if (authenticated) {\n this.services.dialogRef.close();\n }\n }\n\n #errorHandler(err: any): void {\n console.log('Authentication error', err);\n this.errorMessage = `${err.name}: ${err.statusText}`;\n }\n\n changeTokenStorageMode(checked: boolean): void {\n const keyName = 'storeTokenInSession';\n\n if (checked) {\n if (localStorage.getItem(keyName)) {\n localStorage.removeItem(keyName);\n }\n } else {\n localStorage.setItem(keyName, 'true');\n }\n }\n}\n","<h2 mat-dialog-title>\n @if (services.authentication.authenticating) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n <form [formGroup]=\"form\">\n <mat-form-field>\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form.invalid\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}","import {\n Component,\n inject,\n input,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';\n\nimport { MatIcon } from '@angular/material/icon';\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\nimport { LoginFormComponent } from '../login-form/login-form.component';\n\n@Component({\n selector: 'cp-login',\n imports: [MatIcon],\n standalone: true,\n templateUrl: './login.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrls: ['./login.component.scss', '../../../../../styles/mat-icon.scss'],\n})\nexport class LoginComponent {\n #services = {\n dialog: inject(MatDialog),\n };\n services = {\n authentication: inject(MatAuthenticationService),\n };\n //#endregion\n\n adminGroup = input<string>();\n additionalInfo = input<string>();\n\n login(): void {\n this.#services.dialog.open(LoginFormComponent, {\n data: {\n adminGroup: this.adminGroup(),\n additionalInfo: this.additionalInfo(),\n },\n });\n }\n\n confirmLogout(): void {\n this.#services.dialog\n .open(ConfirmationComponent, {\n data: { message: `Are you sure you want to logout?` },\n })\n .afterClosed()\n .subscribe((result) => {\n if (result) {\n this.services.authentication.logout();\n }\n });\n }\n}\n","<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"\n $safeNavigationMigration(\n services.authentication.authenticatedUser?.photoUrl\n )\n \"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n >\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser?.displayName }}\n </div>\n } @else {\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\n </mat-icon>\n }\n</div>\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\n\r\nimport { MatAuthenticationServiceOptions } from './model/mat-authentication-service-options';\r\n\r\n\r\nimport { LoginFormComponent } from './components/login-form/login-form.component';\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { MatAuthenticationServiceOptionsToken } from './model/mat-authentication-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n \r\n MatButtonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatProgressSpinnerModule,\r\n MatSlideToggleModule,\r\n\r\n LoginComponent,\r\n LoginFormComponent\r\n ],\r\n exports: [\r\n LoginComponent,\r\n LoginFormComponent\r\n ]\r\n})\r\nexport class MatAuthenticationModule {\r\n static forRoot(options: MatAuthenticationServiceOptions): ModuleWithProviders<MatAuthenticationModule> {\r\n return {\r\n ngModule: MatAuthenticationModule,\r\n providers: [\r\n {\r\n provide: MatAuthenticationServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: MatAuthenticationModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'MatAuthenticationModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './mat-authentication.api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAGa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,EAAE;;ACYpG,MAAO,wBAAyB,SAAQ,0BAA0B,CAAA;AACtE,IAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC;;AAK9C,IAAA,WAAA,CAAsE,kBAA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AAA;AACD,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd;AACD;AACF,iBAAA;;0BAcc;;0BAAY;;;ACtD3B;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-authentication-sso.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/model/authentication-sso-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/services/authentication-sso.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/components/redirect/authentication-sso-redirect.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/authentication-sso.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/guards/authentication-sso.guard.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/cleavelandprice-ngx-lib-authentication-sso.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { AuthenticationSSOServiceOptions } from \"./authentication-sso-service-options\";\r\n\r\n// What is a InjectionToken?\r\n// An InjectionToken is a way to create a token that can be used to inject a dependency into an Angular service or component.\r\n// It allows you to define a unique identifier for a dependency, which can then be used to retrieve the dependency from the Angular dependency injection system.\r\n// This is particularly useful when you want to inject a value that is not a class, such as a configuration object or a string.\r\n// Great explaination of InjectionToken: https://youtu.be/GvA7xnBmEto?si=_Nc2DTzdsb0jdvuk\r\nexport const AuthenticationSSOServiceOptionsToken = new InjectionToken<AuthenticationSSOServiceOptions>('AuthenticationSSOServiceOptions');\r\n","import { EventEmitter, Inject, Injectable, Optional, Output, signal } from '@angular/core';\r\n\r\nimport { AbstractAuthenticationService, AuthenticatedUser } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\n\r\nimport { AuthenticationSSOServiceOptions } from '../model/authentication-sso-service-options';\r\nimport { AuthenticationSSOServiceOptionsToken } from './../model/authentication-sso-service-options-token';\r\nimport { AuthenticationSSOClaims } from '../model/authentication-sso-claims';\r\n\r\nimport {\r\n AccountInfo,\r\n AuthenticationResult,\r\n BrowserCacheLocation,\r\n PublicClientApplication,\r\n type Configuration\r\n} from '@azure/msal-browser';\r\n\r\n// This service implements authentication using Microsoft Entra ID (formerly Azure AD) via the Microsoft Authentication Library (MSAL).\r\n// It provides methods for logging in, logging out, and validating the authenticated user, while managing token storage and refresh.\r\n// It also supports cross-tab synchronization of authentication state using the BroadcastChannel API.\r\n// It also supports revalidating authentication state when the user returns to a tab after it has been backgrounded for a period of time.\r\n// It also supports storing the token in either localStorage or sessionStorage, based on the user's preference.\r\n// It also supports determining if the token is expired and refreshing it if necessary, or logging the user out if the token cannot be refreshed.\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationSSOService extends NgxLibServiceBase implements AbstractAuthenticationService {\r\n //#region Fields\r\n authenticating = false; // Flag set to true while the service is attempting to authenticate the user\r\n authenticated = false; // Flag set to true when the user is successfully authenticated\r\n authenticatedUser?: AuthenticatedUser; // Object representing the authenticated user\r\n\r\n // error NG8110: Unsupported call to the output function. This function can only be used as the initializer of a property on a @Component or @Directive class.\r\n /*authenticatedChanged = output<boolean>();\r\n authenticatingChanged = output<boolean>();\r\n authenticationError = output();*/\r\n @Output() authenticatedChanged = new EventEmitter<boolean>();\r\n @Output() authenticatingChanged = new EventEmitter<boolean>();\r\n @Output() authenticationError = new EventEmitter();\r\n\r\n // Microsoft Authentication Library (MSAL) instance for handling authentication\r\n #msal: PublicClientApplication;\r\n // Tracks one-time MSAL initialize() completion.\r\n #initialized = false;\r\n\r\n // Cross-tab messaging channel (same-origin tabs only).\r\n #channel?: BroadcastChannel;\r\n // Broadcast payload sent between tabs to synchronize logout.\r\n #logoutMessage = 'logout';\r\n\r\n // Coalescing flags used when syncing auth after tab visibility/focus resumes.\r\n #resumeCheckInProgress = false;\r\n #lastResumeCheckAt = 0;\r\n\r\n // Timer id used to refresh tokens before expiry.\r\n #tokenRefreshTimeoutId?: ReturnType<typeof setTimeout>;\r\n // Treat near-expiry tokens as expired to avoid race conditions during downstream API calls.\r\n #expirationSkewMilliseconds = 30000;\r\n\r\n #expirationEpochSeconds = signal<number | undefined>(undefined);\r\n //#endregion\r\n\r\n //#region Properties\r\n\r\n // I don't agree with these properties being required in the AbstractAuthenticationService interface\r\n // I think this should be set in the options passed to the service.\r\n // I know this is used in the login components under material but a developer who wants to use their own login with sessionStorage would need to know that they need to create a localStorage item called 'storeTokenInSession' and set it to true\r\n // I have added a cacheLocation option to the AuthenticationSSOServiceOptions interface but if the users don't set it, they can use these properties to set the storage location\r\n\r\n get useSessionStorage(): boolean {\r\n return !!localStorage.getItem('storeTokenInSession');\r\n }\r\n\r\n get storage(): Storage {\r\n return this.useSessionStorage ?\r\n sessionStorage:\r\n localStorage;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(AuthenticationSSOServiceOptionsToken) protected options: AuthenticationSSOServiceOptions) {\r\n super(options);\r\n\r\n const authenticationEndpoint = options.authenticationEndpoint ?? `https://login.microsoftonline.com/${options.tenantId}`;\r\n\r\n this.options = {\r\n ...options,\r\n\r\n tokenName: options.tokenName ?? options.clientId + '-token',\r\n authenticationEndpoint\r\n };\r\n\r\n // if the user didn't set the cacheLocation in the options, we will set it to sessionStorage if useSessionStorage is true, otherwise we will set it to localStorage\r\n this.options.cacheLocation = this.options.cacheLocation ?? (this.useSessionStorage ? 'sessionStorage' : 'localStorage');\r\n\r\n // MSAL configuration for this SPA.\r\n // Cache remains in sessionStorage so each tab has isolated auth cache.\r\n const msalConfig: Configuration = {\r\n auth: {\r\n clientId: this.options.clientId,\r\n authority: this.options.authenticationEndpoint,\r\n redirectUri: this.options.redirectUri,\r\n postLogoutRedirectUri: this.options.postLogoutRedirectUri\r\n },\r\n cache: {\r\n cacheLocation: this.options.cacheLocation === 'sessionStorage' ? BrowserCacheLocation.SessionStorage : BrowserCacheLocation.LocalStorage\r\n }\r\n };\r\n\r\n // Create MSAL client based on the configuration.\r\n // We still need to call initialize() before using it, but this ensures that we only create one instance of the client.\r\n this.#msal = new PublicClientApplication(msalConfig);\r\n\r\n // Initialize the BroadcastChannel for cross-tab communication\r\n this.#initializeBroadcastChannel();\r\n\r\n // Register resume listeners so returning to a tab revalidates auth state.\r\n this.#registerResumeListeners();\r\n\r\n // Attempt to restore authenticated state from any existing Microsoft session.\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n\r\n //Authenticate the user and store the token in Local Storage or Session Storage\r\n login(): void {\r\n // There are times this item is left in sessionStorage after logout, which can cause MSAL to think a login is in progress and block future logins.\r\n // This is a workaround to ensure that the item is removed after logout.\r\n if (typeof sessionStorage !== 'undefined' && sessionStorage.getItem(\"msal.interaction.status\"))\r\n sessionStorage.removeItem(\"msal.interaction.status\");\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n console.log('AuthenticationSSOService: login() called. Authenticating user...');\r\n\r\n // Initialize MSAL and then perform login via popup, followed by user validation.\r\n this.#initializeMsal()\r\n .then(() => this.#msal.loginPopup({\r\n scopes: this.options.scopes,\r\n authority: this.options.authenticationEndpoint,\r\n prompt: 'select_account'\r\n }))\r\n .then((result) => this.validateUser(result))\r\n .catch((error: unknown) => {\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(error);\r\n });\r\n }\r\n\r\n // Primary logout flow:\r\n // 1) clear local state in this tab,\r\n // 2) notify other tabs to clear their local state,\r\n // 3) initiate Entra sign-out redirect from this initiating tab.\r\n logout(): void {\r\n this.#logoutLocalOnly(false);\r\n this.#publishLogout();\r\n\r\n // Only the initiating tab should call identity-provider logout.\r\n this.#clearTokenRefreshTimer();\r\n\r\n this.#initializeMsal()\r\n .then(() => this.#msal.logoutRedirect({\r\n postLogoutRedirectUri: this.options.postLogoutRedirectUri\r\n }))\r\n .catch((error) => {\r\n console.log('ERROR: Microsoft logout failed.', error);\r\n });\r\n }\r\n\r\n tokenExists(): boolean {\r\n const token = this.storage.getItem(this.options.tokenName ?? '');\r\n return !!token;\r\n }\r\n\r\n // validateUser() = setAuthenticatedUser()\r\n // Resolves current user and token claims into the app's authenticated model.\r\n // Also validates/refreshes token when needed and schedules proactive refresh.\r\n async validateUser(result?: AuthenticationResult, account?: AccountInfo): Promise<void> {\r\n // Resolve account from auth result or fallback account.\r\n let resolvedAccount = result?.account ?? account;\r\n\r\n console.log('AuthenticationSSOService: Validating user. Result:', result, 'Account:', account, 'ResolvedAccount:', resolvedAccount);\r\n\r\n // No account means app should be considered logged out.\r\n if (!resolvedAccount) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n // Keep MSAL active account in sync with resolved account context.\r\n this.#msal.setActiveAccount(resolvedAccount);\r\n\r\n let resolvedResult = result;\r\n let claims = (resolvedResult?.idTokenClaims ?? resolvedAccount.idTokenClaims ?? {}) as AuthenticationSSOClaims;\r\n\r\n // expiresOn comes over as a Date object if it exists, but exp is a number of seconds since epoch.\r\n // therefore, if expiresOn exists convert it to seconds since epoch, otherwise use exp if it exists, otherwise undefined.\r\n // expiresOn is only present when the token is acquired via acquireTokenSilent or acquireTokenPopup, but not when the token is acquired via loginPopup or loginRedirect.\r\n let expirationEpochSeconds = resolvedResult?.expiresOn ? Math.floor(resolvedResult.expiresOn.getTime() / 1000) : claims.exp ?? undefined;\r\n\r\n // If token appears expired, attempt silent refresh before setting user state.\r\n if (this.#isTokenExpired(expirationEpochSeconds)) {\r\n const refreshedResult = await this.#refreshToken(resolvedAccount);\r\n\r\n // Refresh failure means we should end the session.\r\n if (!refreshedResult?.account) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n resolvedResult = refreshedResult;\r\n resolvedAccount = refreshedResult.account;\r\n claims = (resolvedResult.idTokenClaims ?? resolvedAccount.idTokenClaims ?? {}) as AuthenticationSSOClaims;\r\n expirationEpochSeconds = resolvedResult?.expiresOn ? Math.floor(resolvedResult.expiresOn.getTime() / 1000) : claims.exp ?? undefined;\r\n\r\n // Still expired after refresh; terminate session to avoid stale auth.\r\n if (this.#isTokenExpired(expirationEpochSeconds)) {\r\n this.logout();\r\n return;\r\n }\r\n }\r\n\r\n // Derive a stable account name from available claims.\r\n const preferredUsername = String(claims.preferred_username ?? resolvedAccount.username ?? claims.upn ?? claims.email ?? '');\r\n const accountName = preferredUsername.includes('@') ? preferredUsername.split('@')[0] : preferredUsername;\r\n\r\n // Map Entra claims to the app's authenticated user shape.\r\n this.authenticatedUser = {\r\n admin: false,\r\n accountName: claims.accountName ?? accountName,\r\n department: claims.department ?? '',\r\n displayName: claims.displayName ?? '',\r\n distinguishedName: claims.distinguishedName ?? '',\r\n email: claims.mail,\r\n employeeNumber: claims.employeeNumber,\r\n firstName: claims.firstName ?? '',\r\n hireDate: claims.hireDate ?? '',\r\n lastName: claims.lastName ?? '',\r\n manager: claims.manager,\r\n memberOf: claims.memberOf,\r\n phone: claims.phone,\r\n photoUrl: claims.photoUrl,\r\n sid: claims.securityIdentifier ?? '',\r\n title: claims.title,\r\n workShift: claims.workShift\r\n } as AuthenticatedUser;\r\n\r\n // Persist the most recent id token from the auth result first.\r\n // account.idToken can lag behind after silent refresh in some MSAL flows.\r\n if (this.options.tokenName) {\r\n const token = this.#getLatestIdToken(resolvedResult, resolvedAccount);\r\n if (token) {\r\n this.storage.setItem(this.options.tokenName, token);\r\n } else {\r\n this.storage.removeItem(this.options.tokenName);\r\n }\r\n }\r\n\r\n this.#expirationEpochSeconds.set(expirationEpochSeconds);\r\n\r\n // Schedule refresh before expiration to keep session uninterrupted.\r\n this.#scheduleTokenRefresh(expirationEpochSeconds, resolvedAccount);\r\n\r\n // Publish authenticated state only when it changes.\r\n const wasAuthenticated = this.authenticated;\r\n this.authenticated = true;\r\n if (wasAuthenticated !== this.authenticated) {\r\n this.authenticatedChanged.emit(this.authenticated);\r\n }\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n // Rehydrates auth state from existing cached account on startup.\r\n // We intentionally avoid handleRedirectPromise() because this service uses popup login.\r\n checkForExistingToken(): void {\r\n this.#initializeMsal()\r\n .then(() => {\r\n const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];\r\n if (account)\r\n return this.validateUser(undefined, account);\r\n\r\n // Ensure stale app token is removed when MSAL has no cached account.\r\n return this.#logoutLocalOnly(false);\r\n })\r\n .catch((error: unknown) => {\r\n console.log('ERROR: Failed to hydrate Microsoft auth state.', error);\r\n });\r\n }\r\n\r\n // Initialize MSAL if it hasn't been initialized yet\r\n // This ensures that we only initialize MSAL once, even if multiple login attempts are made\r\n // This is important because there is startup work that must be completed by MSAL before it can be used, and we don't want to repeat that work unnecessarily\r\n async #initializeMsal(): Promise<void> {\r\n if (this.#initialized) {\r\n return;\r\n }\r\n\r\n\r\n await this.#msal.initialize();\r\n this.#initialized = true;\r\n }\r\n\r\n // Sets up same-origin cross-tab messaging used to fan out logout events.\r\n #initializeBroadcastChannel(): void {\r\n if (typeof BroadcastChannel === 'undefined') {\r\n // Some runtimes may not support BroadcastChannel.\r\n return;\r\n }\r\n\r\n // Create a new BroadcastChannel for cross-tab communication\r\n this.#channel = new BroadcastChannel('sso-authentication-channel');\r\n\r\n // Listen for messages from other tabs for logout events.\r\n // When a logout message is received, the current tab will clear its local state and reload the page.\r\n this.#channel.onmessage = (event) => {\r\n if (event.data === this.#logoutMessage) {\r\n console.log('Received logout message from another tab.');\r\n // Receiving tabs clear local state and reload so route guards re-evaluate immediately.\r\n this.#logoutLocalOnly(true);\r\n }\r\n };\r\n }\r\n\r\n // Registers visibility/focus listeners to re-check auth when user returns to the tab.\r\n // Tabs can be backgrounded for long periods, and the user may have logged out in another tab or session.\r\n #registerResumeListeners(): void {\r\n const handleResume = () => {\r\n void this.#syncAuthOnResume();\r\n };\r\n\r\n if (typeof document !== 'undefined') {\r\n document.addEventListener('visibilitychange', () => {\r\n if (document.visibilityState === 'visible') {\r\n handleResume();\r\n }\r\n });\r\n }\r\n\r\n if (typeof window !== 'undefined') {\r\n window.addEventListener('focus', handleResume);\r\n }\r\n }\r\n\r\n // Syncs auth state after resume while preventing duplicate checks from rapid events.\r\n async #syncAuthOnResume(): Promise<void> {\r\n const now = Date.now();\r\n\r\n // visibilitychange and focus often fire back-to-back; coalesce to one check.\r\n // if now was less than 1 second since last check, skip this one.\r\n if (this.#resumeCheckInProgress || now - this.#lastResumeCheckAt < 1000) {\r\n return;\r\n }\r\n\r\n this.#resumeCheckInProgress = true;\r\n this.#lastResumeCheckAt = now;\r\n\r\n try {\r\n await this.#initializeMsal();\r\n\r\n const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];\r\n\r\n if (!account) {\r\n await this.#logoutLocalOnly(false);\r\n return;\r\n }\r\n\r\n await this.validateUser(undefined, account);\r\n }\r\n catch (error) {\r\n console.log('Error: Resume auth sync failed.', error);\r\n }\r\n finally {\r\n this.#resumeCheckInProgress = false;\r\n }\r\n }\r\n\r\n // Sends logout signal to other open tabs.\r\n #publishLogout(): void {\r\n this.#channel?.postMessage(this.#logoutMessage);\r\n }\r\n\r\n // Clears app/MSAL state in current tab without invoking provider-side logout.\r\n // reloadAfterLogout is intended for non-initiating tabs to force UI reset to auth route.\r\n async #logoutLocalOnly(reloadAfterLogout: boolean): Promise<void> {\r\n this.#clearTokenRefreshTimer();\r\n\r\n if (this.options.tokenName && this.storage.getItem(this.options.tokenName)) {\r\n this.storage.removeItem(this.options.tokenName);\r\n }\r\n\r\n const wasAuthenticated = this.authenticated;\r\n this.authenticatedUser = undefined;\r\n this.authenticated = false;\r\n if (wasAuthenticated !== this.authenticated) {\r\n this.authenticatedChanged.emit(false);\r\n }\r\n\r\n try {\r\n await this.#initializeMsal();\r\n await this.#msal.clearCache();\r\n this.#msal.setActiveAccount(null);\r\n\r\n // There are times this item is left in sessionStorage after logout, which can cause MSAL to think a login is in progress and block future logins.\r\n // This is a workaround to ensure that the item is removed after logout.\r\n sessionStorage.removeItem(\"msal.interaction.status\");\r\n\r\n // Secondary tabs should hard-refresh to guarantee route guards and app state reset.\r\n if (reloadAfterLogout && typeof window !== 'undefined') {\r\n window.location.reload();\r\n }\r\n } catch (error) {\r\n console.log('WARN: Local MSAL cache clear failed.', error);\r\n }\r\n }\r\n\r\n // Returns true when token expiration is absent or in the past.\r\n #isTokenExpired(expirationEpochSeconds?: number): boolean {\r\n if (expirationEpochSeconds == null || expirationEpochSeconds == undefined || expirationEpochSeconds <= 0) {\r\n return true;\r\n }\r\n\r\n return Date.now() + this.#expirationSkewMilliseconds >= expirationEpochSeconds * 1000;\r\n }\r\n\r\n // Attempts silent token acquisition for the current account.\r\n async #refreshToken(account: AccountInfo): Promise<AuthenticationResult | undefined> {\r\n try {\r\n return await this.#msal.acquireTokenSilent({\r\n account,\r\n scopes: this.options.scopes\r\n });\r\n }\r\n catch (error) {\r\n console.log('Error: Silent token refresh failed.', error);\r\n return undefined;\r\n }\r\n }\r\n\r\n // Prefers the token returned from the most recent auth result.\r\n #getLatestIdToken(result?: AuthenticationResult, account?: AccountInfo): string | undefined {\r\n return result?.idToken ?? account?.idToken;\r\n }\r\n\r\n // Schedules token refresh shortly before expiration.\r\n // If refresh fails, session is terminated to avoid inconsistent auth state.\r\n #scheduleTokenRefresh(expirationEpochSeconds: number | undefined, account: AccountInfo): void {\r\n this.#clearTokenRefreshTimer();\r\n\r\n if (!expirationEpochSeconds) {\r\n return;\r\n }\r\n\r\n // Convert Unix epoch seconds to milliseconds for Date.now() comparison\r\n const expirationEpochMilliseconds = expirationEpochSeconds * 1000;\r\n // Schedule refresh 1 minute before expiration\r\n const refreshLeadTimeMs = 60000;\r\n // Calculate the delay until the refresh should occur, ensuring it's not negative\r\n const millisecondsUntilRefresh = expirationEpochMilliseconds - Date.now() - refreshLeadTimeMs;\r\n const delay = Math.max(millisecondsUntilRefresh, 0);\r\n\r\n this.#tokenRefreshTimeoutId = setTimeout(() => {\r\n this.#refreshToken(account)\r\n .then((result) => {\r\n console.log('AuthenticationSSOService: Token refresh result.', result);\r\n if (result?.account) {\r\n return this.validateUser(result, result.account);\r\n }\r\n\r\n // No account after refresh implies invalid session.\r\n this.logout();\r\n return undefined;\r\n })\r\n .catch(() => {\r\n // Any refresh exception falls back to logout for safety.\r\n this.logout();\r\n });\r\n }, delay);\r\n }\r\n\r\n // Cancels any pending token refresh timer.\r\n #clearTokenRefreshTimer(): void {\r\n if (!this.#tokenRefreshTimeoutId) {\r\n return;\r\n }\r\n\r\n clearTimeout(this.#tokenRefreshTimeoutId);\r\n this.#tokenRefreshTimeoutId = undefined;\r\n }\r\n //#endregion\r\n}\r\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\r\nimport { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';\r\n\r\n@Component({\r\n selector: 'app-authentication-sso-redirect',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n template: '<p>Processing authentication...</p>',\r\n})\r\nexport class AuthenticationSSORedirectComponent implements OnInit {\r\n ngOnInit(): void {\r\n broadcastResponseToMainFrame().catch((error: Error) => {\r\n console.error('Error broadcasting response to main frame:', error);\r\n });\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { AuthenticationSSOServiceOptions } from './model/authentication-sso-service-options';\r\nimport { AuthenticationSSOServiceOptionsToken } from './model/authentication-sso-service-options-token';\r\nimport { AuthenticationSSORedirectComponent } from './components/redirect/authentication-sso-redirect.component';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n AuthenticationSSORedirectComponent\r\n ],\r\n exports: [\r\n AuthenticationSSORedirectComponent\r\n ]\r\n})\r\nexport class AuthenticationSSOModule {\r\n static forRoot(options: AuthenticationSSOServiceOptions): ModuleWithProviders<AuthenticationSSOModule> {\r\n return {\r\n ngModule: AuthenticationSSOModule,\r\n providers: [\r\n {\r\n provide: AuthenticationSSOServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationSSOModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationSSOModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn, Router } from '@angular/router';\r\nimport { map, take } from 'rxjs/operators';\r\nimport { AuthenticationSSOService } from '../authentication-sso.api';\r\n\r\nexport const authenticationSSOGuard: CanActivateFn = (_route, _state) => {\r\n const authenticationService = inject(AuthenticationSSOService);\r\n const router = inject(Router);\r\n\r\n // if the user is already authenticated, allow access to the route\r\n if (authenticationService.authenticated) {\r\n return true;\r\n }\r\n\r\n if (authenticationService.tokenExists()) {\r\n // we're doing this because we could've opened a new tab and the user is already logged in, so we need to check for an existing token\r\n authenticationService.checkForExistingToken();\r\n\r\n return authenticationService.authenticatedChanged.pipe(\r\n take(1),\r\n map(() => {\r\n if (!authenticationService.authenticated) {\r\n router.navigate(['']);\r\n return false;\r\n }\r\n\r\n return true;\r\n })\r\n );\r\n }\r\n else {\r\n router.navigate(['']);\r\n return false;\r\n }\r\n};\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './authentication-sso.api';\n"],"names":[],"mappings":";;;;;;;;;AAGA;AACA;AACA;AACA;AACA;MACa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,iCAAiC;;ACUzI;AACA;AACA;AACA;AACA;AACA;AAIM,MAAO,wBAAyB,SAAQ,iBAAiB,CAAA;;AAe7D,IAAA,KAAK;;AAEL,IAAA,YAAY;;AAGZ,IAAA,QAAQ;;AAER,IAAA,cAAc;;AAGd,IAAA,sBAAsB;AACtB,IAAA,kBAAkB;;AAGlB,IAAA,sBAAsB;;AAEtB,IAAA,2BAA2B;AAE3B,IAAA,uBAAuB;;;;;;;AAUvB,IAAA,IAAI,iBAAiB,GAAA;QACnB,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,qBAAq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E;AAE7C,QAAA,OAAO,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CACpD,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,MAAK;AACP,YAAA,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE;AACxC,gBAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACrB,gBAAA,OAAO,KAAK;YACd;AAEA,YAAA,OAAO,IAAI;QACb,CAAC,CAAC,CACH;IACH;SACK;AACH,QAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACrB,QAAA,OAAO,KAAK;IACd;AACF;;AClCA;;AAEG;;;;"}
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-authentication-sso.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/model/authentication-sso-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/services/authentication-sso.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/components/redirect/authentication-sso-redirect.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/authentication-sso.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/guards/authentication-sso.guard.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/cleavelandprice-ngx-lib-authentication-sso.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { AuthenticationSSOServiceOptions } from \"./authentication-sso-service-options\";\r\n\r\n// What is a InjectionToken?\r\n// An InjectionToken is a way to create a token that can be used to inject a dependency into an Angular service or component.\r\n// It allows you to define a unique identifier for a dependency, which can then be used to retrieve the dependency from the Angular dependency injection system.\r\n// This is particularly useful when you want to inject a value that is not a class, such as a configuration object or a string.\r\n// Great explaination of InjectionToken: https://youtu.be/GvA7xnBmEto?si=_Nc2DTzdsb0jdvuk\r\nexport const AuthenticationSSOServiceOptionsToken = new InjectionToken<AuthenticationSSOServiceOptions>('AuthenticationSSOServiceOptions');\r\n","import { EventEmitter, Inject, Injectable, Optional, Output, signal } from '@angular/core';\r\n\r\nimport { AbstractAuthenticationService, AuthenticatedUser } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\n\r\nimport { AuthenticationSSOServiceOptions } from '../model/authentication-sso-service-options';\r\nimport { AuthenticationSSOServiceOptionsToken } from './../model/authentication-sso-service-options-token';\r\nimport { AuthenticationSSOClaims } from '../model/authentication-sso-claims';\r\n\r\nimport {\r\n AccountInfo,\r\n AuthenticationResult,\r\n BrowserCacheLocation,\r\n PublicClientApplication,\r\n type Configuration\r\n} from '@azure/msal-browser';\r\n\r\n// This service implements authentication using Microsoft Entra ID (formerly Azure AD) via the Microsoft Authentication Library (MSAL).\r\n// It provides methods for logging in, logging out, and validating the authenticated user, while managing token storage and refresh.\r\n// It also supports cross-tab synchronization of authentication state using the BroadcastChannel API.\r\n// It also supports revalidating authentication state when the user returns to a tab after it has been backgrounded for a period of time.\r\n// It also supports storing the token in either localStorage or sessionStorage, based on the user's preference.\r\n// It also supports determining if the token is expired and refreshing it if necessary, or logging the user out if the token cannot be refreshed.\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationSSOService extends NgxLibServiceBase implements AbstractAuthenticationService {\r\n //#region Fields\r\n authenticating = false; // Flag set to true while the service is attempting to authenticate the user\r\n authenticated = false; // Flag set to true when the user is successfully authenticated\r\n authenticatedUser?: AuthenticatedUser; // Object representing the authenticated user\r\n\r\n // error NG8110: Unsupported call to the output function. This function can only be used as the initializer of a property on a @Component or @Directive class.\r\n /*authenticatedChanged = output<boolean>();\r\n authenticatingChanged = output<boolean>();\r\n authenticationError = output();*/\r\n @Output() authenticatedChanged = new EventEmitter<boolean>();\r\n @Output() authenticatingChanged = new EventEmitter<boolean>();\r\n @Output() authenticationError = new EventEmitter();\r\n\r\n // Microsoft Authentication Library (MSAL) instance for handling authentication\r\n #msal: PublicClientApplication;\r\n // Tracks one-time MSAL initialize() completion.\r\n #initialized = false;\r\n\r\n // Cross-tab messaging channel (same-origin tabs only).\r\n #channel?: BroadcastChannel;\r\n // Broadcast payload sent between tabs to synchronize logout.\r\n #logoutMessage = 'logout';\r\n\r\n // Coalescing flags used when syncing auth after tab visibility/focus resumes.\r\n #resumeCheckInProgress = false;\r\n #lastResumeCheckAt = 0;\r\n\r\n // Timer id used to refresh tokens before expiry.\r\n #tokenRefreshTimeoutId?: ReturnType<typeof setTimeout>;\r\n // Treat near-expiry tokens as expired to avoid race conditions during downstream API calls.\r\n #expirationSkewMilliseconds = 30000;\r\n\r\n #expirationEpochSeconds = signal<number | undefined>(undefined);\r\n //#endregion\r\n\r\n //#region Properties\r\n\r\n // I don't agree with these properties being required in the AbstractAuthenticationService interface\r\n // I think this should be set in the options passed to the service.\r\n // I know this is used in the login components under material but a developer who wants to use their own login with sessionStorage would need to know that they need to create a localStorage item called 'storeTokenInSession' and set it to true\r\n // I have added a cacheLocation option to the AuthenticationSSOServiceOptions interface but if the users don't set it, they can use these properties to set the storage location\r\n\r\n get useSessionStorage(): boolean {\r\n return !!localStorage.getItem('storeTokenInSession');\r\n }\r\n\r\n get storage(): Storage {\r\n return this.useSessionStorage ?\r\n sessionStorage:\r\n localStorage;\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(AuthenticationSSOServiceOptionsToken) protected options: AuthenticationSSOServiceOptions) {\r\n super(options);\r\n\r\n const authenticationEndpoint = options.authenticationEndpoint ?? `https://login.microsoftonline.com/${options.tenantId}`;\r\n\r\n this.options = {\r\n ...options,\r\n\r\n tokenName: options.tokenName ?? options.clientId + '-token',\r\n authenticationEndpoint\r\n };\r\n\r\n // if the user didn't set the cacheLocation in the options, we will set it to sessionStorage if useSessionStorage is true, otherwise we will set it to localStorage\r\n this.options.cacheLocation = this.options.cacheLocation ?? (this.useSessionStorage ? 'sessionStorage' : 'localStorage');\r\n\r\n // MSAL configuration for this SPA.\r\n // Cache remains in sessionStorage so each tab has isolated auth cache.\r\n const msalConfig: Configuration = {\r\n auth: {\r\n clientId: this.options.clientId,\r\n authority: this.options.authenticationEndpoint,\r\n redirectUri: this.options.redirectUri,\r\n postLogoutRedirectUri: this.options.postLogoutRedirectUri\r\n },\r\n cache: {\r\n cacheLocation: this.options.cacheLocation === 'sessionStorage' ? BrowserCacheLocation.SessionStorage : BrowserCacheLocation.LocalStorage\r\n }\r\n };\r\n\r\n // Create MSAL client based on the configuration.\r\n // We still need to call initialize() before using it, but this ensures that we only create one instance of the client.\r\n this.#msal = new PublicClientApplication(msalConfig);\r\n\r\n // Initialize the BroadcastChannel for cross-tab communication\r\n this.#initializeBroadcastChannel();\r\n\r\n // Register resume listeners so returning to a tab revalidates auth state.\r\n this.#registerResumeListeners();\r\n\r\n // Attempt to restore authenticated state from any existing Microsoft session.\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n\r\n //Authenticate the user and store the token in Local Storage or Session Storage\r\n login(): void {\r\n // There are times this item is left in sessionStorage after logout, which can cause MSAL to think a login is in progress and block future logins.\r\n // This is a workaround to ensure that the item is removed after logout.\r\n if (typeof sessionStorage !== 'undefined' && sessionStorage.getItem(\"msal.interaction.status\"))\r\n sessionStorage.removeItem(\"msal.interaction.status\");\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n console.log('AuthenticationSSOService: login() called. Authenticating user...');\r\n\r\n // Initialize MSAL and then perform login via popup, followed by user validation.\r\n this.#initializeMsal()\r\n .then(() => this.#msal.loginPopup({\r\n scopes: this.options.scopes,\r\n authority: this.options.authenticationEndpoint,\r\n prompt: 'select_account'\r\n }))\r\n .then((result) => this.validateUser(result))\r\n .catch((error: unknown) => {\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(error);\r\n });\r\n }\r\n\r\n // Primary logout flow:\r\n // 1) clear local state in this tab,\r\n // 2) notify other tabs to clear their local state,\r\n // 3) initiate Entra sign-out redirect from this initiating tab.\r\n logout(): void {\r\n this.#logoutLocalOnly(false);\r\n this.#publishLogout();\r\n\r\n // Only the initiating tab should call identity-provider logout.\r\n this.#clearTokenRefreshTimer();\r\n\r\n this.#initializeMsal()\r\n .then(() => this.#msal.logoutRedirect({\r\n postLogoutRedirectUri: this.options.postLogoutRedirectUri\r\n }))\r\n .catch((error) => {\r\n console.log('ERROR: Microsoft logout failed.', error);\r\n });\r\n }\r\n\r\n tokenExists(): boolean {\r\n const token = this.storage.getItem(this.options.tokenName ?? '');\r\n return !!token;\r\n }\r\n\r\n // validateUser() = setAuthenticatedUser()\r\n // Resolves current user and token claims into the app's authenticated model.\r\n // Also validates/refreshes token when needed and schedules proactive refresh.\r\n async validateUser(result?: AuthenticationResult, account?: AccountInfo): Promise<void> {\r\n // Resolve account from auth result or fallback account.\r\n let resolvedAccount = result?.account ?? account;\r\n\r\n console.log('AuthenticationSSOService: Validating user. Result:', result, 'Account:', account, 'ResolvedAccount:', resolvedAccount);\r\n\r\n // No account means app should be considered logged out.\r\n if (!resolvedAccount) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n // Keep MSAL active account in sync with resolved account context.\r\n this.#msal.setActiveAccount(resolvedAccount);\r\n\r\n let resolvedResult = result;\r\n let claims = (resolvedResult?.idTokenClaims ?? resolvedAccount.idTokenClaims ?? {}) as AuthenticationSSOClaims;\r\n\r\n // expiresOn comes over as a Date object if it exists, but exp is a number of seconds since epoch.\r\n // therefore, if expiresOn exists convert it to seconds since epoch, otherwise use exp if it exists, otherwise undefined.\r\n // expiresOn is only present when the token is acquired via acquireTokenSilent or acquireTokenPopup, but not when the token is acquired via loginPopup or loginRedirect.\r\n let expirationEpochSeconds = resolvedResult?.expiresOn ? Math.floor(resolvedResult.expiresOn.getTime() / 1000) : claims.exp ?? undefined;\r\n\r\n // If token appears expired, attempt silent refresh before setting user state.\r\n if (this.#isTokenExpired(expirationEpochSeconds)) {\r\n const refreshedResult = await this.#refreshToken(resolvedAccount);\r\n\r\n // Refresh failure means we should end the session.\r\n if (!refreshedResult?.account) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n resolvedResult = refreshedResult;\r\n resolvedAccount = refreshedResult.account;\r\n claims = (resolvedResult.idTokenClaims ?? resolvedAccount.idTokenClaims ?? {}) as AuthenticationSSOClaims;\r\n expirationEpochSeconds = resolvedResult?.expiresOn ? Math.floor(resolvedResult.expiresOn.getTime() / 1000) : claims.exp ?? undefined;\r\n\r\n // Still expired after refresh; terminate session to avoid stale auth.\r\n if (this.#isTokenExpired(expirationEpochSeconds)) {\r\n this.logout();\r\n return;\r\n }\r\n }\r\n\r\n // Derive a stable account name from available claims.\r\n const preferredUsername = String(claims.preferred_username ?? resolvedAccount.username ?? claims.upn ?? claims.email ?? '');\r\n const accountName = preferredUsername.includes('@') ? preferredUsername.split('@')[0] : preferredUsername;\r\n\r\n // Map Entra claims to the app's authenticated user shape.\r\n this.authenticatedUser = {\r\n admin: false,\r\n accountName: claims.accountName ?? accountName,\r\n department: claims.department ?? '',\r\n displayName: claims.displayName ?? '',\r\n distinguishedName: claims.distinguishedName ?? '',\r\n email: claims.mail,\r\n employeeNumber: claims.employeeNumber,\r\n firstName: claims.firstName ?? '',\r\n hireDate: claims.hireDate ?? '',\r\n lastName: claims.lastName ?? '',\r\n manager: claims.manager,\r\n memberOf: claims.memberOf,\r\n phone: claims.phone,\r\n photoUrl: claims.photoUrl,\r\n sid: claims.securityIdentifier ?? '',\r\n title: claims.title,\r\n workShift: claims.workShift\r\n } as AuthenticatedUser;\r\n\r\n // Persist the most recent id token from the auth result first.\r\n // account.idToken can lag behind after silent refresh in some MSAL flows.\r\n if (this.options.tokenName) {\r\n const token = this.#getLatestIdToken(resolvedResult, resolvedAccount);\r\n if (token) {\r\n this.storage.setItem(this.options.tokenName, token);\r\n } else {\r\n this.storage.removeItem(this.options.tokenName);\r\n }\r\n }\r\n\r\n this.#expirationEpochSeconds.set(expirationEpochSeconds);\r\n\r\n // Schedule refresh before expiration to keep session uninterrupted.\r\n this.#scheduleTokenRefresh(expirationEpochSeconds, resolvedAccount);\r\n\r\n // Publish authenticated state only when it changes.\r\n const wasAuthenticated = this.authenticated;\r\n this.authenticated = true;\r\n if (wasAuthenticated !== this.authenticated) {\r\n this.authenticatedChanged.emit(this.authenticated);\r\n }\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n // Rehydrates auth state from existing cached account on startup.\r\n // We intentionally avoid handleRedirectPromise() because this service uses popup login.\r\n checkForExistingToken(): void {\r\n this.#initializeMsal()\r\n .then(() => {\r\n const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];\r\n if (account)\r\n return this.validateUser(undefined, account);\r\n\r\n // Ensure stale app token is removed when MSAL has no cached account.\r\n return this.#logoutLocalOnly(false);\r\n })\r\n .catch((error: unknown) => {\r\n console.log('ERROR: Failed to hydrate Microsoft auth state.', error);\r\n });\r\n }\r\n\r\n // Initialize MSAL if it hasn't been initialized yet\r\n // This ensures that we only initialize MSAL once, even if multiple login attempts are made\r\n // This is important because there is startup work that must be completed by MSAL before it can be used, and we don't want to repeat that work unnecessarily\r\n async #initializeMsal(): Promise<void> {\r\n if (this.#initialized) {\r\n return;\r\n }\r\n\r\n\r\n await this.#msal.initialize();\r\n this.#initialized = true;\r\n }\r\n\r\n // Sets up same-origin cross-tab messaging used to fan out logout events.\r\n #initializeBroadcastChannel(): void {\r\n if (typeof BroadcastChannel === 'undefined') {\r\n // Some runtimes may not support BroadcastChannel.\r\n return;\r\n }\r\n\r\n // Create a new BroadcastChannel for cross-tab communication\r\n this.#channel = new BroadcastChannel('sso-authentication-channel');\r\n\r\n // Listen for messages from other tabs for logout events.\r\n // When a logout message is received, the current tab will clear its local state and reload the page.\r\n this.#channel.onmessage = (event) => {\r\n if (event.data === this.#logoutMessage) {\r\n console.log('Received logout message from another tab.');\r\n // Receiving tabs clear local state and reload so route guards re-evaluate immediately.\r\n this.#logoutLocalOnly(true);\r\n }\r\n };\r\n }\r\n\r\n // Registers visibility/focus listeners to re-check auth when user returns to the tab.\r\n // Tabs can be backgrounded for long periods, and the user may have logged out in another tab or session.\r\n #registerResumeListeners(): void {\r\n const handleResume = () => {\r\n void this.#syncAuthOnResume();\r\n };\r\n\r\n if (typeof document !== 'undefined') {\r\n document.addEventListener('visibilitychange', () => {\r\n if (document.visibilityState === 'visible') {\r\n handleResume();\r\n }\r\n });\r\n }\r\n\r\n if (typeof window !== 'undefined') {\r\n window.addEventListener('focus', handleResume);\r\n }\r\n }\r\n\r\n // Syncs auth state after resume while preventing duplicate checks from rapid events.\r\n async #syncAuthOnResume(): Promise<void> {\r\n const now = Date.now();\r\n\r\n // visibilitychange and focus often fire back-to-back; coalesce to one check.\r\n // if now was less than 1 second since last check, skip this one.\r\n if (this.#resumeCheckInProgress || now - this.#lastResumeCheckAt < 1000) {\r\n return;\r\n }\r\n\r\n this.#resumeCheckInProgress = true;\r\n this.#lastResumeCheckAt = now;\r\n\r\n try {\r\n await this.#initializeMsal();\r\n\r\n const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];\r\n\r\n if (!account) {\r\n await this.#logoutLocalOnly(false);\r\n return;\r\n }\r\n\r\n await this.validateUser(undefined, account);\r\n }\r\n catch (error) {\r\n console.log('Error: Resume auth sync failed.', error);\r\n }\r\n finally {\r\n this.#resumeCheckInProgress = false;\r\n }\r\n }\r\n\r\n // Sends logout signal to other open tabs.\r\n #publishLogout(): void {\r\n this.#channel?.postMessage(this.#logoutMessage);\r\n }\r\n\r\n // Clears app/MSAL state in current tab without invoking provider-side logout.\r\n // reloadAfterLogout is intended for non-initiating tabs to force UI reset to auth route.\r\n async #logoutLocalOnly(reloadAfterLogout: boolean): Promise<void> {\r\n this.#clearTokenRefreshTimer();\r\n\r\n if (this.options.tokenName && this.storage.getItem(this.options.tokenName)) {\r\n this.storage.removeItem(this.options.tokenName);\r\n }\r\n\r\n const wasAuthenticated = this.authenticated;\r\n this.authenticatedUser = undefined;\r\n this.authenticated = false;\r\n if (wasAuthenticated !== this.authenticated) {\r\n this.authenticatedChanged.emit(false);\r\n }\r\n\r\n try {\r\n await this.#initializeMsal();\r\n await this.#msal.clearCache();\r\n this.#msal.setActiveAccount(null);\r\n\r\n // There are times this item is left in sessionStorage after logout, which can cause MSAL to think a login is in progress and block future logins.\r\n // This is a workaround to ensure that the item is removed after logout.\r\n sessionStorage.removeItem(\"msal.interaction.status\");\r\n\r\n // Secondary tabs should hard-refresh to guarantee route guards and app state reset.\r\n if (reloadAfterLogout && typeof window !== 'undefined') {\r\n window.location.reload();\r\n }\r\n } catch (error) {\r\n console.log('WARN: Local MSAL cache clear failed.', error);\r\n }\r\n }\r\n\r\n // Returns true when token expiration is absent or in the past.\r\n #isTokenExpired(expirationEpochSeconds?: number): boolean {\r\n if (expirationEpochSeconds == null || expirationEpochSeconds == undefined || expirationEpochSeconds <= 0) {\r\n return true;\r\n }\r\n\r\n return Date.now() + this.#expirationSkewMilliseconds >= expirationEpochSeconds * 1000;\r\n }\r\n\r\n // Attempts silent token acquisition for the current account.\r\n async #refreshToken(account: AccountInfo): Promise<AuthenticationResult | undefined> {\r\n try {\r\n return await this.#msal.acquireTokenSilent({\r\n account,\r\n scopes: this.options.scopes\r\n });\r\n }\r\n catch (error) {\r\n console.log('Error: Silent token refresh failed.', error);\r\n return undefined;\r\n }\r\n }\r\n\r\n // Prefers the token returned from the most recent auth result.\r\n #getLatestIdToken(result?: AuthenticationResult, account?: AccountInfo): string | undefined {\r\n return result?.idToken ?? account?.idToken;\r\n }\r\n\r\n // Schedules token refresh shortly before expiration.\r\n // If refresh fails, session is terminated to avoid inconsistent auth state.\r\n #scheduleTokenRefresh(expirationEpochSeconds: number | undefined, account: AccountInfo): void {\r\n this.#clearTokenRefreshTimer();\r\n\r\n if (!expirationEpochSeconds) {\r\n return;\r\n }\r\n\r\n // Convert Unix epoch seconds to milliseconds for Date.now() comparison\r\n const expirationEpochMilliseconds = expirationEpochSeconds * 1000;\r\n // Schedule refresh 1 minute before expiration\r\n const refreshLeadTimeMs = 60000;\r\n // Calculate the delay until the refresh should occur, ensuring it's not negative\r\n const millisecondsUntilRefresh = expirationEpochMilliseconds - Date.now() - refreshLeadTimeMs;\r\n const delay = Math.max(millisecondsUntilRefresh, 0);\r\n\r\n this.#tokenRefreshTimeoutId = setTimeout(() => {\r\n this.#refreshToken(account)\r\n .then((result) => {\r\n console.log('AuthenticationSSOService: Token refresh result.', result);\r\n if (result?.account) {\r\n return this.validateUser(result, result.account);\r\n }\r\n\r\n // No account after refresh implies invalid session.\r\n this.logout();\r\n return undefined;\r\n })\r\n .catch(() => {\r\n // Any refresh exception falls back to logout for safety.\r\n this.logout();\r\n });\r\n }, delay);\r\n }\r\n\r\n // Cancels any pending token refresh timer.\r\n #clearTokenRefreshTimer(): void {\r\n if (!this.#tokenRefreshTimeoutId) {\r\n return;\r\n }\r\n\r\n clearTimeout(this.#tokenRefreshTimeoutId);\r\n this.#tokenRefreshTimeoutId = undefined;\r\n }\r\n //#endregion\r\n}\r\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';\n\n@Component({\n selector: 'app-authentication-sso-redirect',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.Eager,\n template: '<p>Processing authentication...</p>',\n})\nexport class AuthenticationSSORedirectComponent implements OnInit {\n ngOnInit(): void {\n broadcastResponseToMainFrame().catch((error: Error) => {\n console.error('Error broadcasting response to main frame:', error);\n });\n }\n}\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { AuthenticationSSOServiceOptions } from './model/authentication-sso-service-options';\r\nimport { AuthenticationSSOServiceOptionsToken } from './model/authentication-sso-service-options-token';\r\nimport { AuthenticationSSORedirectComponent } from './components/redirect/authentication-sso-redirect.component';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n AuthenticationSSORedirectComponent\r\n ],\r\n exports: [\r\n AuthenticationSSORedirectComponent\r\n ]\r\n})\r\nexport class AuthenticationSSOModule {\r\n static forRoot(options: AuthenticationSSOServiceOptions): ModuleWithProviders<AuthenticationSSOModule> {\r\n return {\r\n ngModule: AuthenticationSSOModule,\r\n providers: [\r\n {\r\n provide: AuthenticationSSOServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationSSOModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationSSOModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn, Router } from '@angular/router';\r\nimport { map, take } from 'rxjs/operators';\r\nimport { AuthenticationSSOService } from '../authentication-sso.api';\r\n\r\nexport const authenticationSSOGuard: CanActivateFn = (_route, _state) => {\r\n const authenticationService = inject(AuthenticationSSOService);\r\n const router = inject(Router);\r\n\r\n // if the user is already authenticated, allow access to the route\r\n if (authenticationService.authenticated) {\r\n return true;\r\n }\r\n\r\n if (authenticationService.tokenExists()) {\r\n // we're doing this because we could've opened a new tab and the user is already logged in, so we need to check for an existing token\r\n authenticationService.checkForExistingToken();\r\n\r\n return authenticationService.authenticatedChanged.pipe(\r\n take(1),\r\n map(() => {\r\n if (!authenticationService.authenticated) {\r\n router.navigate(['']);\r\n return false;\r\n }\r\n\r\n return true;\r\n })\r\n );\r\n }\r\n else {\r\n router.navigate(['']);\r\n return false;\r\n }\r\n};\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './authentication-sso.api';\n"],"names":[],"mappings":";;;;;;;;;AAGA;AACA;AACA;AACA;AACA;MACa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,iCAAiC;;ACUzI;AACA;AACA;AACA;AACA;AACA;AAIM,MAAO,wBAAyB,SAAQ,iBAAiB,CAAA;;AAe7D,IAAA,KAAK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,MAAM,qBAAqB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAC9D,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;AAG7B,IAAA,IAAI,qBAAqB,CAAC,aAAa,EAAE;AACvC,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,qBAAqB,CAAC,WAAW,EAAE,EAAE;;QAEvC,qBAAqB,CAAC,qBAAqB,EAAE;AAE7C,QAAA,OAAO,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CACpD,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,MAAK;AACP,YAAA,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE;AACxC,gBAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACrB,gBAAA,OAAO,KAAK;YACd;AAEA,YAAA,OAAO,IAAI;QACb,CAAC,CAAC,CACH;IACH;SACK;AACH,QAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACrB,QAAA,OAAO,KAAK;IACd;AACF;;AClCA;;AAEG;;;;"}
@@ -104,7 +104,7 @@ class BaseComponent {
104
104
  this.closed.emit(data);
105
105
  }
106
106
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
107
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: BaseComponent, isStandalone: true, selector: "cp-dialog-base", inputs: { dialogType: { classPropertyName: "dialogType", publicName: "dialogType", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: "@if (data().title) {\r\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\r\n}\r\n\r\n<mat-dialog-content>\r\n @if (data().message) {\r\n <div [innerHTML]=\"data().message\"></div>\r\n }\r\n\r\n @if (dialogType() === DialogType.Input) {\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n }\r\n\r\n @if (data().checkboxMessage) {\r\n <div id=\"checkbox\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"data().checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n }\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n @if (dialogType() !== DialogType.Choice) {\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>Yes</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>True</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customTrueText }}</span>\r\n }\r\n @default {\r\n <span>OK</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n @if (dialogType() !== DialogType.Message) {\r\n <button mat-raised-button (click)=\"cancel()\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>No</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>False</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customFalseText }}</span>\r\n }\r\n @default {\r\n <span>Cancel</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n\r\n @if (dialogType() === DialogType.Choice) {\r\n @for (choice of choices; track choice; let i = $index) {\r\n <button mat-raised-button [matDialogClose]=\"i\">\r\n <span>{{ choice }}</span>\r\n </button>\r\n }\r\n }\r\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { 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", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
107
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: BaseComponent, isStandalone: true, selector: "cp-dialog-base", inputs: { dialogType: { classPropertyName: "dialogType", publicName: "dialogType", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: "@if (data().title) {\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\n}\n\n<mat-dialog-content>\n @if (data().message) {\n <div [innerHTML]=\"data().message\"></div>\n }\n\n @if (dialogType() === DialogType.Input) {\n <mat-form-field>\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\n </mat-form-field>\n }\n\n @if (data().checkboxMessage) {\n <div id=\"checkbox\">\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\n <span [innerHTML]=\"data().checkboxMessage\"></span>\n </mat-checkbox>\n </div>\n }\n</mat-dialog-content>\n\n<mat-dialog-actions>\n @if (dialogType() !== DialogType.Choice) {\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>Yes</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>True</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customTrueText }}</span>\n }\n @default {\n <span>OK</span>\n }\n }\n </span>\n </button>\n @if (dialogType() !== DialogType.Message) {\n <button mat-raised-button (click)=\"cancel()\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>No</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>False</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customFalseText }}</span>\n }\n @default {\n <span>Cancel</span>\n }\n }\n </span>\n </button>\n }\n }\n\n @if (dialogType() === DialogType.Choice) {\n @for (choice of choices; track choice; let i = $index) {\n <button mat-raised-button [matDialogClose]=\"i\">\n <span>{{ choice }}</span>\n </button>\n }\n }\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { 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", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
108
108
  }
109
109
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BaseComponent, decorators: [{
110
110
  type: Component,
@@ -115,7 +115,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
115
115
  MatFormFieldModule,
116
116
  MatInputModule,
117
117
  FormsModule,
118
- ], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "@if (data().title) {\r\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\r\n}\r\n\r\n<mat-dialog-content>\r\n @if (data().message) {\r\n <div [innerHTML]=\"data().message\"></div>\r\n }\r\n\r\n @if (dialogType() === DialogType.Input) {\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n }\r\n\r\n @if (data().checkboxMessage) {\r\n <div id=\"checkbox\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"data().checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n }\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n @if (dialogType() !== DialogType.Choice) {\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>Yes</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>True</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customTrueText }}</span>\r\n }\r\n @default {\r\n <span>OK</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n @if (dialogType() !== DialogType.Message) {\r\n <button mat-raised-button (click)=\"cancel()\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>No</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>False</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customFalseText }}</span>\r\n }\r\n @default {\r\n <span>Cancel</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n\r\n @if (dialogType() === DialogType.Choice) {\r\n @for (choice of choices; track choice; let i = $index) {\r\n <button mat-raised-button [matDialogClose]=\"i\">\r\n <span>{{ choice }}</span>\r\n </button>\r\n }\r\n }\r\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"] }]
118
+ ], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "@if (data().title) {\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\n}\n\n<mat-dialog-content>\n @if (data().message) {\n <div [innerHTML]=\"data().message\"></div>\n }\n\n @if (dialogType() === DialogType.Input) {\n <mat-form-field>\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\n </mat-form-field>\n }\n\n @if (data().checkboxMessage) {\n <div id=\"checkbox\">\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\n <span [innerHTML]=\"data().checkboxMessage\"></span>\n </mat-checkbox>\n </div>\n }\n</mat-dialog-content>\n\n<mat-dialog-actions>\n @if (dialogType() !== DialogType.Choice) {\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>Yes</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>True</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customTrueText }}</span>\n }\n @default {\n <span>OK</span>\n }\n }\n </span>\n </button>\n @if (dialogType() !== DialogType.Message) {\n <button mat-raised-button (click)=\"cancel()\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>No</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>False</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customFalseText }}</span>\n }\n @default {\n <span>Cancel</span>\n }\n }\n </span>\n </button>\n }\n }\n\n @if (dialogType() === DialogType.Choice) {\n @for (choice of choices; track choice; let i = $index) {\n <button mat-raised-button [matDialogClose]=\"i\">\n <span>{{ choice }}</span>\n </button>\n }\n }\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"] }]
119
119
  }], propDecorators: { dialogType: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogType", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
120
120
 
121
121
  class ChoiceComponent {
@@ -127,11 +127,11 @@ class ChoiceComponent {
127
127
  this.dialogType = DialogType.Choice;
128
128
  }
129
129
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ChoiceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
130
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: ChoiceComponent, isStandalone: true, selector: "cp-dialog-choice", ngImport: i0, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
130
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: ChoiceComponent, isStandalone: true, selector: "cp-dialog-choice", ngImport: i0, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
131
131
  }
132
132
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ChoiceComponent, decorators: [{
133
133
  type: Component,
134
- args: [{ selector: 'cp-dialog-choice', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>" }]
134
+ args: [{ selector: 'cp-dialog-choice', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>" }]
135
135
  }] });
136
136
 
137
137
  class ConfirmationComponent {
@@ -143,11 +143,11 @@ class ConfirmationComponent {
143
143
  this.dialogType = DialogType.Confirmation;
144
144
  }
145
145
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ConfirmationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
146
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: ConfirmationComponent, isStandalone: true, selector: "cp-dialog-confirmation", ngImport: i0, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
146
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: ConfirmationComponent, isStandalone: true, selector: "cp-dialog-confirmation", ngImport: i0, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
147
147
  }
148
148
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ConfirmationComponent, decorators: [{
149
149
  type: Component,
150
- args: [{ selector: 'cp-dialog-confirmation', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>" }]
150
+ args: [{ selector: 'cp-dialog-confirmation', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>" }]
151
151
  }] });
152
152
 
153
153
  class InputComponent {
@@ -159,11 +159,11 @@ class InputComponent {
159
159
  this.dialogType = DialogType.Input;
160
160
  }
161
161
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
162
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: InputComponent, isStandalone: true, selector: "cp-dialog-input", ngImport: i0, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
162
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: InputComponent, isStandalone: true, selector: "cp-dialog-input", ngImport: i0, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
163
163
  }
164
164
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: InputComponent, decorators: [{
165
165
  type: Component,
166
- args: [{ selector: 'cp-dialog-input', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>" }]
166
+ args: [{ selector: 'cp-dialog-input', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>" }]
167
167
  }] });
168
168
 
169
169
  class MessageComponent {
@@ -175,11 +175,11 @@ class MessageComponent {
175
175
  this.dialogType = DialogType.Message;
176
176
  }
177
177
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: MessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
178
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: MessageComponent, isStandalone: true, selector: "cp-dialog-message", ngImport: i0, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
178
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: MessageComponent, isStandalone: true, selector: "cp-dialog-message", ngImport: i0, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
179
179
  }
180
180
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: MessageComponent, decorators: [{
181
181
  type: Component,
182
- args: [{ selector: 'cp-dialog-message', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>" }]
182
+ args: [{ selector: 'cp-dialog-message', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>" }]
183
183
  }] });
184
184
 
185
185
  class DialogModule {