@arsedizioni/ars-utils 22.0.41 → 22.0.43

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.
@@ -5,7 +5,7 @@ import * as i1 from '@angular/material/button';
5
5
  import { MatButtonModule } from '@angular/material/button';
6
6
  import { EnvironmentService } from '@arsedizioni/ars-utils/core';
7
7
  import * as i1$1 from '@arsedizioni/ars-utils/ui';
8
- import { DialogService, FlexModule } from '@arsedizioni/ars-utils/ui';
8
+ import { DialogService, FlexLayoutModule } from '@arsedizioni/ars-utils/ui';
9
9
  import { MsalBroadcastService, MsalService, MSAL_INSTANCE, MSAL_GUARD_CONFIG, MSAL_INTERCEPTOR_CONFIG } from '@azure/msal-angular';
10
10
  import { PublicClientApplication, BrowserCacheLocation, InteractionType, EventType } from '@azure/msal-browser';
11
11
  import { filter } from 'rxjs';
@@ -275,11 +275,11 @@ class LoginOAuthOkMSComponent {
275
275
  });
276
276
  }
277
277
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LoginOAuthOkMSComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
278
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.1", type: LoginOAuthOkMSComponent, isStandalone: true, selector: "app-login-oauth-ok-ms", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i1$1.FxLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg], [fxLayout.sm-up], [fxLayout.md-up], [fxLayout.lg-up], [fxLayout.xl-up], [fxLayout.sm-down], [fxLayout.md-down], [fxLayout.lg-down] ", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg", "fxLayout.sm-up", "fxLayout.md-up", "fxLayout.lg-up", "fxLayout.xl-up", "fxLayout.sm-down", "fxLayout.md-down", "fxLayout.lg-down"] }, { kind: "directive", type: i1$1.FxLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg], [fxLayoutAlign.sm-up], [fxLayoutAlign.md-up], [fxLayoutAlign.lg-up], [fxLayoutAlign.xl-up], [fxLayoutAlign.sm-down], [fxLayoutAlign.md-down], [fxLayoutAlign.lg-down] ", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg", "fxLayoutAlign.sm-up", "fxLayoutAlign.md-up", "fxLayoutAlign.lg-up", "fxLayoutAlign.xl-up", "fxLayoutAlign.sm-down", "fxLayoutAlign.md-down", "fxLayoutAlign.lg-down"] }, { kind: "directive", type: i1$1.FxFlexFillDirective, selector: " [fxFlexFill], [fxFill], [fxFlexFill.xs], [fxFlexFill.sm], [fxFlexFill.md], [fxFlexFill.lg], [fxFlexFill.xl], [fxFlexFill.lt-sm], [fxFlexFill.lt-md], [fxFlexFill.lt-lg], [fxFlexFill.lt-xl], [fxFlexFill.gt-xs], [fxFlexFill.gt-sm], [fxFlexFill.gt-md], [fxFlexFill.gt-lg], [fxFlexFill.sm-up], [fxFlexFill.md-up], [fxFlexFill.lg-up], [fxFlexFill.xl-up], [fxFlexFill.sm-down], [fxFlexFill.md-down], [fxFlexFill.lg-down] ", inputs: ["fxFlexFill", "fxFill", "fxFlexFill.xs", "fxFlexFill.sm", "fxFlexFill.md", "fxFlexFill.lg", "fxFlexFill.xl", "fxFlexFill.lt-sm", "fxFlexFill.lt-md", "fxFlexFill.lt-lg", "fxFlexFill.lt-xl", "fxFlexFill.gt-xs", "fxFlexFill.gt-sm", "fxFlexFill.gt-md", "fxFlexFill.gt-lg", "fxFlexFill.sm-up", "fxFlexFill.md-up", "fxFlexFill.lg-up", "fxFlexFill.xl-up", "fxFlexFill.sm-down", "fxFlexFill.md-down", "fxFlexFill.lg-down"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
278
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.1", type: LoginOAuthOkMSComponent, isStandalone: true, selector: "app-login-oauth-ok-ms", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"], dependencies: [{ kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: i1$1.FxLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg], [fxLayout.sm-up], [fxLayout.md-up], [fxLayout.lg-up], [fxLayout.xl-up], [fxLayout.sm-down], [fxLayout.md-down], [fxLayout.lg-down] ", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg", "fxLayout.sm-up", "fxLayout.md-up", "fxLayout.lg-up", "fxLayout.xl-up", "fxLayout.sm-down", "fxLayout.md-down", "fxLayout.lg-down"] }, { kind: "directive", type: i1$1.FxLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg], [fxLayoutAlign.sm-up], [fxLayoutAlign.md-up], [fxLayoutAlign.lg-up], [fxLayoutAlign.xl-up], [fxLayoutAlign.sm-down], [fxLayoutAlign.md-down], [fxLayoutAlign.lg-down] ", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg", "fxLayoutAlign.sm-up", "fxLayoutAlign.md-up", "fxLayoutAlign.lg-up", "fxLayoutAlign.xl-up", "fxLayoutAlign.sm-down", "fxLayoutAlign.md-down", "fxLayoutAlign.lg-down"] }, { kind: "directive", type: i1$1.FxFlexFillDirective, selector: " [fxFlexFill], [fxFill], [fxFlexFill.xs], [fxFlexFill.sm], [fxFlexFill.md], [fxFlexFill.lg], [fxFlexFill.xl], [fxFlexFill.lt-sm], [fxFlexFill.lt-md], [fxFlexFill.lt-lg], [fxFlexFill.lt-xl], [fxFlexFill.gt-xs], [fxFlexFill.gt-sm], [fxFlexFill.gt-md], [fxFlexFill.gt-lg], [fxFlexFill.sm-up], [fxFlexFill.md-up], [fxFlexFill.lg-up], [fxFlexFill.xl-up], [fxFlexFill.sm-down], [fxFlexFill.md-down], [fxFlexFill.lg-down] ", inputs: ["fxFlexFill", "fxFill", "fxFlexFill.xs", "fxFlexFill.sm", "fxFlexFill.md", "fxFlexFill.lg", "fxFlexFill.xl", "fxFlexFill.lt-sm", "fxFlexFill.lt-md", "fxFlexFill.lt-lg", "fxFlexFill.lt-xl", "fxFlexFill.gt-xs", "fxFlexFill.gt-sm", "fxFlexFill.gt-md", "fxFlexFill.gt-lg", "fxFlexFill.sm-up", "fxFlexFill.md-up", "fxFlexFill.lg-up", "fxFlexFill.xl-up", "fxFlexFill.sm-down", "fxFlexFill.md-down", "fxFlexFill.lg-down"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
279
279
  }
280
280
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LoginOAuthOkMSComponent, decorators: [{
281
281
  type: Component,
282
- args: [{ selector: 'app-login-oauth-ok-ms', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FlexModule, MatProgressBarModule], template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"] }]
282
+ args: [{ selector: 'app-login-oauth-ok-ms', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FlexLayoutModule, MatProgressBarModule], template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"] }]
283
283
  }], ctorParameters: () => [], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });
284
284
 
285
285
  /*
@@ -1 +1 @@
1
- {"version":3,"file":"arsedizioni-ars-utils-ui.oauth.mjs","sources":["../../../projects/ars-utils/ui.oauth/ui/definitions.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.html","../../../projects/ars-utils/ui.oauth/ui/components/login-ok/ms/login-oauth-ok-ms.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login-ok/ms/login-oauth-ok-ms.component.html","../../../projects/ars-utils/ui.oauth/public_api.ts","../../../projects/ars-utils/ui.oauth/arsedizioni-ars-utils-ui.oauth.ts"],"sourcesContent":["export enum LoginOAuthType {\r\n None = 0,\r\n Microsoft = 1,\r\n Google = 2\r\n}\r\n\r\nexport interface LoginOAuthResult {\r\n type: LoginOAuthType,\r\n token: string\r\n}","import { ChangeDetectionStrategy, Component, DestroyRef, NgZone, afterNextRender, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatButtonModule } from '@angular/material/button';\nimport { EnvironmentService } from '@arsedizioni/ars-utils/core';\nimport { DialogService } from '@arsedizioni/ars-utils/ui';\nimport { MSAL_GUARD_CONFIG, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalBroadcastService, MsalGuardConfiguration, MsalInterceptorConfiguration, MsalService } from '@azure/msal-angular';\nimport { AuthenticationResult, BrowserCacheLocation, EventMessage, EventType, IPublicClientApplication, InteractionType, PublicClientApplication } from '@azure/msal-browser';\nimport { filter } from 'rxjs';\nimport { LoginOAuthResult, LoginOAuthType } from '../../definitions';\n\n/** Default Azure app registration — overridable via EnvironmentService. */\nconst DEFAULT_MS_CLIENT_ID = '6b2c080f-6ab0-4511-a9df-0bce69db5833';\nconst MS_AUTH_SCOPE = `api://${DEFAULT_MS_CLIENT_ID}/AngularSPAAuthScope`;\n\nexport function MSALInstanceFactory(environment: EnvironmentService): IPublicClientApplication {\n return new PublicClientApplication({\n auth: {\n clientId: (environment as any).msalClientId ?? DEFAULT_MS_CLIENT_ID,\n authority: (environment as any).msalAuthority ?? 'https://login.microsoftonline.com/common',\n redirectUri: environment.appLoginRedirectUri,\n },\n cache: {\n cacheLocation: BrowserCacheLocation.LocalStorage\n }\n });\n}\n\nexport function MSALInterceptorConfigFactory(environment: EnvironmentService): MsalInterceptorConfiguration {\n\n return {\n interactionType: InteractionType.Popup,\n protectedResourceMap: new Map([\n [environment.appServiceLoginUri, [MS_AUTH_SCOPE]],\n [\"https://graph.microsoft.com/v2.0/me\", [\"user.read\"]],\n ])\n };\n}\n\nexport function MSALGuardConfigFactory(): MsalGuardConfiguration {\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: [\"user.read\"]\n }\n };\n}\n\n@Component({\n selector: 'login-oauth',\n templateUrl: './login-oauth.component.html',\n styleUrls: ['./login-oauth.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: MSAL_INSTANCE,\n deps: [EnvironmentService],\n useFactory: MSALInstanceFactory\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALGuardConfigFactory\n },\n {\n provide: MSAL_INTERCEPTOR_CONFIG,\n deps: [EnvironmentService],\n useFactory: MSALInterceptorConfigFactory\n },\n MsalService,\n MsalBroadcastService],\n imports: [\n MatButtonModule\n ]\n})\nexport class LoginOAuthComponent {\n private readonly destroyRef = inject(DestroyRef);\n private readonly msalBroadcastService = inject(MsalBroadcastService);\n private readonly msaLService = inject(MsalService);\n private readonly dialogService = inject(DialogService);\n private readonly ngZone = inject(NgZone);\n /** Emitted when OAuth authentication succeeds. */\n readonly success = output<LoginOAuthResult>();\n /** Whether to show the introductory info panel. */\n readonly showInfo = input<boolean>(true);\n /** Application name displayed in the info panel. */\n readonly applicationName = input<string>();\n /** Whether to trigger `initialize()` automatically on mount. */\n readonly autoInitialize = input<boolean>(false);\n /** Whether the Microsoft login button is shown. */\n readonly allowMicrosoft = input<boolean>(true);\n /** Whether the Google login button is shown. */\n readonly allowGoogle = input<boolean>(true);\n /** Google OAuth client id. Override per deployment. */\n readonly googleClientId = input<string>('71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com');\n /** MSAL access-token scope requested after login. */\n readonly msalScope = input<string>(MS_AUTH_SCOPE);\n protected readonly oauthReady = signal<boolean>(false);\n protected readonly oauthMicrosoftReady = signal<boolean>(false);\n protected readonly oauthGoogleReady = signal<boolean>(false);\n /** Hidden GSI button proxy, created once the Google library is ready. */\n private googleButtonWrapper?: { click: () => void };\n\n constructor() {\n\n this.msalBroadcastService.msalSubject$\n .pipe(\n filter((msg: EventMessage) =>\n msg.eventType === EventType.LOGOUT_FAILURE ||\n msg.eventType === EventType.ACQUIRE_TOKEN_FAILURE),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe((r: EventMessage) => {\n if (r?.payload) {\n const error = r.payload as any;\n this.dialogService.error(error?.message ?? 'Errore di autenticazione Microsoft');\n }\n });\n\n afterNextRender(() => {\n if (this.autoInitialize()) {\n this.initialize();\n }\n });\n\n }\n\n /**\n * Initialize OAuth providers (Microsoft MSAL and Google GSI).\n * Safe to call multiple times — already-initialized providers are skipped.\n * Must be public so the host component can trigger it manually when `autoInitialize` is false.\n */\n initialize() {\n this.oauthReady.set(true);\n\n // Initialize the Microsoft stack only when allowed and not already done.\n if (this.allowMicrosoft() && !this.oauthMicrosoftReady()) {\n this.msaLService.initialize()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: () => this.oauthMicrosoftReady.set(true),\n error: (error: any) =>\n this.dialogService.error(error?.message ?? 'Errore di inizializzazione Microsoft'),\n });\n }\n\n // Load the Google GSI script only when allowed and not already done.\n if (this.allowGoogle() && !this.oauthGoogleReady()) {\n // @ts-ignore — define the callback BEFORE the script loads so GSI can find it\n window.onGoogleLibraryLoad = () => {\n // @ts-ignore\n google.accounts.id.initialize({\n client_id: this.googleClientId(),\n cancel_on_tap_outside: true,\n auto_select: false,\n callback: (r: any) => {\n this.ngZone.run(() => {\n this.success.emit({ type: LoginOAuthType.Google, token: r.credential });\n });\n }\n });\n\n this.googleButtonWrapper = createFakeGoogleWrapper();\n this.ngZone.run(() => this.oauthGoogleReady.set(true));\n };\n\n // Reuse the script tag if a previous instance already added it.\n const existing = document.querySelector<HTMLScriptElement>('script[data-gsi=\"ars\"]');\n if (existing) {\n // @ts-ignore — library already present: run the callback directly\n if (window.google?.accounts?.id) window.onGoogleLibraryLoad();\n } else {\n const script = document.createElement('script');\n script.src = 'https://accounts.google.com/gsi/client';\n script.async = true;\n script.defer = true;\n script.dataset['gsi'] = 'ars';\n script.onerror = () => this.ngZone.run(() =>\n this.dialogService.error('Impossibile caricare il servizio di accesso Google.'));\n // Append and LEAVE it in the DOM so the browser actually fetches it.\n document.body.appendChild(script);\n }\n }\n }\n\n /**\n * Trigger a Microsoft (MSAL) login popup and acquire an access token on success.\n */\n protected loginMSAL() {\n // Clear any in-progress interaction flag that may have been left by a previous incomplete popup\n sessionStorage.removeItem('msal.interaction.status');\n\n this.msaLService.loginPopup()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (r: AuthenticationResult) => {\n try {\n this.msaLService.instance.setActiveAccount(r.account);\n this.msaLService.acquireTokenSilent({\n scopes: [this.msalScope()],\n account: r.account\n }).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (tokenResult: AuthenticationResult) => {\n this.success.emit({ type: LoginOAuthType.Microsoft, token: tokenResult.accessToken });\n },\n error: (error: any) => {\n this.dialogService.error(error.message);\n }\n });\n } catch (error: any) {\n this.dialogService.error(error.message);\n }\n },\n error: (error: any) => {\n this.dialogService.error(error.message);\n }\n });\n }\n\n /**\n * Trigger the hidden Google GSI button to open the Google sign-in flow.\n */\n protected loginGoogle() {\n // Use the wrapper click to avoid an \"Illegal invocation\" exception.\n // Guard: the button only exists once the GSI library has loaded.\n if (!this.googleButtonWrapper) {\n this.dialogService.error('Il servizio di accesso Google non è ancora pronto.');\n return;\n }\n this.googleButtonWrapper.click();\n }\n}\n\nconst createFakeGoogleWrapper = (): { click: () => void } => {\n const googleLoginWrapper = document.createElement(\"div\");\n googleLoginWrapper.style.display = \"none\";\n googleLoginWrapper.classList.add(\"custom-google-button\");\n document.body.appendChild(googleLoginWrapper);\n\n // Render the (invisible) GSI button inside our wrapper.\n // @ts-ignore\n window.google.accounts.id.renderButton(googleLoginWrapper, {\n type: \"icon\",\n width: \"200\",\n });\n\n const googleLoginWrapperButton =\n googleLoginWrapper.querySelector<HTMLElement>(\"div[role=button]\");\n\n return {\n click: () => googleLoginWrapperButton?.click(),\n };\n};\n\n","<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';\nimport { FlexModule } from '@arsedizioni/ars-utils/ui';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n\n@Component({\n selector: 'app-login-oauth-ok-ms',\n styleUrls: ['./login-oauth-ok-ms.component.scss'],\n templateUrl: './login-oauth-ok-ms.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FlexModule, MatProgressBarModule]\n})\nexport class LoginOAuthOkMSComponent {\n\n /** Message displayed while the popup is completing authentication. */\n readonly message = input<string>('Accesso in corso...');\n\n constructor() {\n // MSAL v5 popup flow: parse the auth response from the URL and send\n // it back to the opener window via BroadcastChannel, then close the popup.\n // The promise can reject (e.g. COOP misconfiguration); log instead of\n // leaving an unhandled rejection that silently strands the popup.\n broadcastResponseToMainFrame().catch((error: unknown) => {\n console.error('Errore durante la comunicazione della risposta di autenticazione:', error);\n });\n }\n}\n","<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n","/*\r\n * Public API Surface of scm-utils\r\n */\r\nexport * from './ui/definitions';\r\nexport * from './ui/components/index';\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,cAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,cAAA,CAAA,cAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa;AACb,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAU;AACZ,CAAC,EAJW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;;ACU1B;AACA,MAAM,oBAAoB,GAAG,sCAAsC;AACnE,MAAM,aAAa,GAAG,CAAA,MAAA,EAAS,oBAAoB,sBAAsB;AAEnE,SAAU,mBAAmB,CAAC,WAA+B,EAAA;IACjE,OAAO,IAAI,uBAAuB,CAAC;AACjC,QAAA,IAAI,E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A,IAAA,EDGc,UAAU,24FAAE,oBAAoB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,cAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,aAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAEjC,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAPnC,SAAS;+BACI,uBAAuB,EAAA,eAAA,EAGhB,uBAAuB,CAAC,MAAM,WACtC,CAAC,UAAU,EAAE,oBAAoB,CAAC,EAAA,QAAA,EAAA,2SAAA,EAAA,MAAA,EAAA,CAAA,+KAAA,CAAA,EAAA;;;AEX/C;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"arsedizioni-ars-utils-ui.oauth.mjs","sources":["../../../projects/ars-utils/ui.oauth/ui/definitions.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.html","../../../projects/ars-utils/ui.oauth/ui/components/login-ok/ms/login-oauth-ok-ms.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login-ok/ms/login-oauth-ok-ms.component.html","../../../projects/ars-utils/ui.oauth/public_api.ts","../../../projects/ars-utils/ui.oauth/arsedizioni-ars-utils-ui.oauth.ts"],"sourcesContent":["export enum LoginOAuthType {\r\n None = 0,\r\n Microsoft = 1,\r\n Google = 2\r\n}\r\n\r\nexport interface LoginOAuthResult {\r\n type: LoginOAuthType,\r\n token: string\r\n}","import { ChangeDetectionStrategy, Component, DestroyRef, NgZone, afterNextRender, inject, input, output, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatButtonModule } from '@angular/material/button';\nimport { EnvironmentService } from '@arsedizioni/ars-utils/core';\nimport { DialogService } from '@arsedizioni/ars-utils/ui';\nimport { MSAL_GUARD_CONFIG, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalBroadcastService, MsalGuardConfiguration, MsalInterceptorConfiguration, MsalService } from '@azure/msal-angular';\nimport { AuthenticationResult, BrowserCacheLocation, EventMessage, EventType, IPublicClientApplication, InteractionType, PublicClientApplication } from '@azure/msal-browser';\nimport { filter } from 'rxjs';\nimport { LoginOAuthResult, LoginOAuthType } from '../../definitions';\n\n/** Default Azure app registration — overridable via EnvironmentService. */\nconst DEFAULT_MS_CLIENT_ID = '6b2c080f-6ab0-4511-a9df-0bce69db5833';\nconst MS_AUTH_SCOPE = `api://${DEFAULT_MS_CLIENT_ID}/AngularSPAAuthScope`;\n\nexport function MSALInstanceFactory(environment: EnvironmentService): IPublicClientApplication {\n return new PublicClientApplication({\n auth: {\n clientId: (environment as any).msalClientId ?? DEFAULT_MS_CLIENT_ID,\n authority: (environment as any).msalAuthority ?? 'https://login.microsoftonline.com/common',\n redirectUri: environment.appLoginRedirectUri,\n },\n cache: {\n cacheLocation: BrowserCacheLocation.LocalStorage\n }\n });\n}\n\nexport function MSALInterceptorConfigFactory(environment: EnvironmentService): MsalInterceptorConfiguration {\n\n return {\n interactionType: InteractionType.Popup,\n protectedResourceMap: new Map([\n [environment.appServiceLoginUri, [MS_AUTH_SCOPE]],\n [\"https://graph.microsoft.com/v2.0/me\", [\"user.read\"]],\n ])\n };\n}\n\nexport function MSALGuardConfigFactory(): MsalGuardConfiguration {\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: [\"user.read\"]\n }\n };\n}\n\n@Component({\n selector: 'login-oauth',\n templateUrl: './login-oauth.component.html',\n styleUrls: ['./login-oauth.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: MSAL_INSTANCE,\n deps: [EnvironmentService],\n useFactory: MSALInstanceFactory\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALGuardConfigFactory\n },\n {\n provide: MSAL_INTERCEPTOR_CONFIG,\n deps: [EnvironmentService],\n useFactory: MSALInterceptorConfigFactory\n },\n MsalService,\n MsalBroadcastService],\n imports: [\n MatButtonModule\n ]\n})\nexport class LoginOAuthComponent {\n private readonly destroyRef = inject(DestroyRef);\n private readonly msalBroadcastService = inject(MsalBroadcastService);\n private readonly msaLService = inject(MsalService);\n private readonly dialogService = inject(DialogService);\n private readonly ngZone = inject(NgZone);\n /** Emitted when OAuth authentication succeeds. */\n readonly success = output<LoginOAuthResult>();\n /** Whether to show the introductory info panel. */\n readonly showInfo = input<boolean>(true);\n /** Application name displayed in the info panel. */\n readonly applicationName = input<string>();\n /** Whether to trigger `initialize()` automatically on mount. */\n readonly autoInitialize = input<boolean>(false);\n /** Whether the Microsoft login button is shown. */\n readonly allowMicrosoft = input<boolean>(true);\n /** Whether the Google login button is shown. */\n readonly allowGoogle = input<boolean>(true);\n /** Google OAuth client id. Override per deployment. */\n readonly googleClientId = input<string>('71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com');\n /** MSAL access-token scope requested after login. */\n readonly msalScope = input<string>(MS_AUTH_SCOPE);\n protected readonly oauthReady = signal<boolean>(false);\n protected readonly oauthMicrosoftReady = signal<boolean>(false);\n protected readonly oauthGoogleReady = signal<boolean>(false);\n /** Hidden GSI button proxy, created once the Google library is ready. */\n private googleButtonWrapper?: { click: () => void };\n\n constructor() {\n\n this.msalBroadcastService.msalSubject$\n .pipe(\n filter((msg: EventMessage) =>\n msg.eventType === EventType.LOGOUT_FAILURE ||\n msg.eventType === EventType.ACQUIRE_TOKEN_FAILURE),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe((r: EventMessage) => {\n if (r?.payload) {\n const error = r.payload as any;\n this.dialogService.error(error?.message ?? 'Errore di autenticazione Microsoft');\n }\n });\n\n afterNextRender(() => {\n if (this.autoInitialize()) {\n this.initialize();\n }\n });\n\n }\n\n /**\n * Initialize OAuth providers (Microsoft MSAL and Google GSI).\n * Safe to call multiple times — already-initialized providers are skipped.\n * Must be public so the host component can trigger it manually when `autoInitialize` is false.\n */\n initialize() {\n this.oauthReady.set(true);\n\n // Initialize the Microsoft stack only when allowed and not already done.\n if (this.allowMicrosoft() && !this.oauthMicrosoftReady()) {\n this.msaLService.initialize()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: () => this.oauthMicrosoftReady.set(true),\n error: (error: any) =>\n this.dialogService.error(error?.message ?? 'Errore di inizializzazione Microsoft'),\n });\n }\n\n // Load the Google GSI script only when allowed and not already done.\n if (this.allowGoogle() && !this.oauthGoogleReady()) {\n // @ts-ignore — define the callback BEFORE the script loads so GSI can find it\n window.onGoogleLibraryLoad = () => {\n // @ts-ignore\n google.accounts.id.initialize({\n client_id: this.googleClientId(),\n cancel_on_tap_outside: true,\n auto_select: false,\n callback: (r: any) => {\n this.ngZone.run(() => {\n this.success.emit({ type: LoginOAuthType.Google, token: r.credential });\n });\n }\n });\n\n this.googleButtonWrapper = createFakeGoogleWrapper();\n this.ngZone.run(() => this.oauthGoogleReady.set(true));\n };\n\n // Reuse the script tag if a previous instance already added it.\n const existing = document.querySelector<HTMLScriptElement>('script[data-gsi=\"ars\"]');\n if (existing) {\n // @ts-ignore — library already present: run the callback directly\n if (window.google?.accounts?.id) window.onGoogleLibraryLoad();\n } else {\n const script = document.createElement('script');\n script.src = 'https://accounts.google.com/gsi/client';\n script.async = true;\n script.defer = true;\n script.dataset['gsi'] = 'ars';\n script.onerror = () => this.ngZone.run(() =>\n this.dialogService.error('Impossibile caricare il servizio di accesso Google.'));\n // Append and LEAVE it in the DOM so the browser actually fetches it.\n document.body.appendChild(script);\n }\n }\n }\n\n /**\n * Trigger a Microsoft (MSAL) login popup and acquire an access token on success.\n */\n protected loginMSAL() {\n // Clear any in-progress interaction flag that may have been left by a previous incomplete popup\n sessionStorage.removeItem('msal.interaction.status');\n\n this.msaLService.loginPopup()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (r: AuthenticationResult) => {\n try {\n this.msaLService.instance.setActiveAccount(r.account);\n this.msaLService.acquireTokenSilent({\n scopes: [this.msalScope()],\n account: r.account\n }).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (tokenResult: AuthenticationResult) => {\n this.success.emit({ type: LoginOAuthType.Microsoft, token: tokenResult.accessToken });\n },\n error: (error: any) => {\n this.dialogService.error(error.message);\n }\n });\n } catch (error: any) {\n this.dialogService.error(error.message);\n }\n },\n error: (error: any) => {\n this.dialogService.error(error.message);\n }\n });\n }\n\n /**\n * Trigger the hidden Google GSI button to open the Google sign-in flow.\n */\n protected loginGoogle() {\n // Use the wrapper click to avoid an \"Illegal invocation\" exception.\n // Guard: the button only exists once the GSI library has loaded.\n if (!this.googleButtonWrapper) {\n this.dialogService.error('Il servizio di accesso Google non è ancora pronto.');\n return;\n }\n this.googleButtonWrapper.click();\n }\n}\n\nconst createFakeGoogleWrapper = (): { click: () => void } => {\n const googleLoginWrapper = document.createElement(\"div\");\n googleLoginWrapper.style.display = \"none\";\n googleLoginWrapper.classList.add(\"custom-google-button\");\n document.body.appendChild(googleLoginWrapper);\n\n // Render the (invisible) GSI button inside our wrapper.\n // @ts-ignore\n window.google.accounts.id.renderButton(googleLoginWrapper, {\n type: \"icon\",\n width: \"200\",\n });\n\n const googleLoginWrapperButton =\n googleLoginWrapper.querySelector<HTMLElement>(\"div[role=button]\");\n\n return {\n click: () => googleLoginWrapperButton?.click(),\n };\n};\n\n","<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';\nimport { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n\n@Component({\n selector: 'app-login-oauth-ok-ms',\n styleUrls: ['./login-oauth-ok-ms.component.scss'],\n templateUrl: './login-oauth-ok-ms.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FlexLayoutModule, MatProgressBarModule]\n})\nexport class LoginOAuthOkMSComponent {\n\n /** Message displayed while the popup is completing authentication. */\n readonly message = input<string>('Accesso in corso...');\n\n constructor() {\n // MSAL v5 popup flow: parse the auth response from the URL and send\n // it back to the opener window via BroadcastChannel, then close the popup.\n // The promise can reject (e.g. COOP misconfiguration); log instead of\n // leaving an unhandled rejection that silently strands the popup.\n broadcastResponseToMainFrame().catch((error: unknown) => {\n console.error('Errore durante la comunicazione della risposta di autenticazione:', error);\n });\n }\n}\n","<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n","/*\r\n * Public API Surface of scm-utils\r\n */\r\nexport * from './ui/definitions';\r\nexport * from './ui/components/index';\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n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
  {
2
2
  "name": "@arsedizioni/ars-utils",
3
- "version": "22.0.41",
3
+ "version": "22.0.43",
4
4
  "author": {
5
5
  "email": "software@arsedizioni.it",
6
6
  "name": "Fabio Buscaroli, Alberto Doria"
@@ -973,6 +973,16 @@ declare function validateBasis(basis: string, grow?: string, shrink?: string): s
973
973
  * Matches ngx-layout output exactly (useColumnBasisZero = true, the default).
974
974
  */
975
975
  declare function buildFlexStyles(value: string, direction: string, hasWrap: boolean): Record<string, string | null>;
976
+ /**
977
+ * Resolves the non-ngx fxFlex extensions to a value `buildFlexStyles` understands.
978
+ * • '*' → 'grow' (fill the remaining space → `flex: 1 1 100%`, max-* 100%)
979
+ * • '' with a `*` sibling → 'none' (`0 0 auto`)
980
+ * • anything else → returned unchanged
981
+ * @param raw - The resolved fxFlex value for the active breakpoint.
982
+ * @param hasStarSibling - Whether a sibling element declares `fxFlex="*"`.
983
+ * @returns The value to pass to `buildFlexStyles`.
984
+ */
985
+ declare function resolveFlexInput(raw: string, hasStarSibling: boolean): string;
976
986
  declare class FxFlexDirective extends ResponsiveBaseDirective {
977
987
  /** Direct ancestor FxLayout (any level); matched to the direct parent in the effect. */
978
988
  private readonly parentLayout;
@@ -1395,11 +1405,11 @@ declare class FxClassDirective extends ResponsiveBaseDirective {
1395
1405
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<FxClassDirective, " [fxClass], [fxClass.xs], [fxClass.sm], [fxClass.md], [fxClass.lg], [fxClass.xl], [fxClass.lt-sm], [fxClass.lt-md], [fxClass.lt-lg], [fxClass.lt-xl], [fxClass.gt-xs], [fxClass.gt-sm], [fxClass.gt-md], [fxClass.gt-lg], [fxClass.sm-up], [fxClass.md-up], [fxClass.lg-up], [fxClass.xl-up], [fxClass.sm-down], [fxClass.md-down], [fxClass.lg-down] ", never, { "fxClass": { "alias": "fxClass"; "required": false; "isSignal": true; }; "xs": { "alias": "fxClass.xs"; "required": false; "isSignal": true; }; "sm": { "alias": "fxClass.sm"; "required": false; "isSignal": true; }; "md": { "alias": "fxClass.md"; "required": false; "isSignal": true; }; "lg": { "alias": "fxClass.lg"; "required": false; "isSignal": true; }; "xl": { "alias": "fxClass.xl"; "required": false; "isSignal": true; }; "ltSm": { "alias": "fxClass.lt-sm"; "required": false; "isSignal": true; }; "ltMd": { "alias": "fxClass.lt-md"; "required": false; "isSignal": true; }; "ltLg": { "alias": "fxClass.lt-lg"; "required": false; "isSignal": true; }; "ltXl": { "alias": "fxClass.lt-xl"; "required": false; "isSignal": true; }; "gtXs": { "alias": "fxClass.gt-xs"; "required": false; "isSignal": true; }; "gtSm": { "alias": "fxClass.gt-sm"; "required": false; "isSignal": true; }; "gtMd": { "alias": "fxClass.gt-md"; "required": false; "isSignal": true; }; "gtLg": { "alias": "fxClass.gt-lg"; "required": false; "isSignal": true; }; "smUp": { "alias": "fxClass.sm-up"; "required": false; "isSignal": true; }; "mdUp": { "alias": "fxClass.md-up"; "required": false; "isSignal": true; }; "lgUp": { "alias": "fxClass.lg-up"; "required": false; "isSignal": true; }; "xlUp": { "alias": "fxClass.xl-up"; "required": false; "isSignal": true; }; "smDown": { "alias": "fxClass.sm-down"; "required": false; "isSignal": true; }; "mdDown": { "alias": "fxClass.md-down"; "required": false; "isSignal": true; }; "lgDown": { "alias": "fxClass.lg-down"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1396
1406
  }
1397
1407
 
1398
- declare class FlexModule {
1399
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<FlexModule, never>;
1400
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<FlexModule, never, [typeof FxLayoutDirective, typeof FxLayoutWrapDirective, typeof FxFlexDirective, typeof FxShowHideDirective, typeof FxLayoutAlignDirective, typeof FxLayoutGapDirective, typeof FxFlexOrderDirective, typeof FxFlexOffsetDirective, typeof FxFlexAlignDirective, typeof FxFlexFillDirective, typeof FxStyleDirective, typeof FxClassDirective, typeof FxGridDirective, typeof FxGridColumnDirective, typeof FxGridAreaDirective, typeof IfBpDirective], [typeof FxLayoutDirective, typeof FxLayoutWrapDirective, typeof FxFlexDirective, typeof FxShowHideDirective, typeof FxLayoutAlignDirective, typeof FxLayoutGapDirective, typeof FxFlexOrderDirective, typeof FxFlexOffsetDirective, typeof FxFlexAlignDirective, typeof FxFlexFillDirective, typeof FxStyleDirective, typeof FxClassDirective, typeof FxGridDirective, typeof FxGridColumnDirective, typeof FxGridAreaDirective, typeof IfBpDirective]>;
1401
- static ɵinj: _angular_core.ɵɵInjectorDeclaration<FlexModule>;
1408
+ declare class FlexLayoutModule {
1409
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FlexLayoutModule, never>;
1410
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<FlexLayoutModule, never, [typeof FxLayoutDirective, typeof FxLayoutWrapDirective, typeof FxFlexDirective, typeof FxShowHideDirective, typeof FxLayoutAlignDirective, typeof FxLayoutGapDirective, typeof FxFlexOrderDirective, typeof FxFlexOffsetDirective, typeof FxFlexAlignDirective, typeof FxFlexFillDirective, typeof FxStyleDirective, typeof FxClassDirective, typeof FxGridDirective, typeof FxGridColumnDirective, typeof FxGridAreaDirective, typeof IfBpDirective], [typeof FxLayoutDirective, typeof FxLayoutWrapDirective, typeof FxFlexDirective, typeof FxShowHideDirective, typeof FxLayoutAlignDirective, typeof FxLayoutGapDirective, typeof FxFlexOrderDirective, typeof FxFlexOffsetDirective, typeof FxFlexAlignDirective, typeof FxFlexFillDirective, typeof FxStyleDirective, typeof FxClassDirective, typeof FxGridDirective, typeof FxGridColumnDirective, typeof FxGridAreaDirective, typeof IfBpDirective]>;
1411
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<FlexLayoutModule>;
1402
1412
  }
1403
1413
 
1404
- export { ALIAS_FAMILIES, ALIAS_INDEX, BS5_BREAKPOINTS, BusyDialogComponent, BusyTimer, CANONICAL_ALIASES, ConfirmDialogComponent, CredentialsDialogComponent, DeleteDialogComponent, DeleteDialogConfirmMode, DialogService, FlexModule, FxClassDirective, FxFlexAlignDirective, FxFlexDirective, FxFlexFillDirective, FxFlexOffsetDirective, FxFlexOrderDirective, FxGridAreaDirective, FxGridColumnDirective, FxGridDirective, FxLayoutAlignDirective, FxLayoutDirective, FxLayoutGapDirective, FxLayoutWrapDirective, FxShowHideDirective, FxStyleDirective, IfBpDirective, InfoDialogComponent, LAYOUT_BREAKPOINTS, LAYOUT_VALUES, MediaObserver, NON_CANONICAL_PRIORITY, OtpInputComponent, PaginatorIntl, PasswordStrengthComponent, RecoverPasswordDialogComponent, ResetPasswordDialogComponent, ResponsiveBaseDirective, ToastComponent, UIService, applyVisibility, buildAlignStyles, buildFlexStyles, buildLayoutCSS, resolve, resolveAll, resolveNonCanonical, resolveParentFlow, validateBasis, validateLayoutValue, validateWrapValue };
1414
+ export { ALIAS_FAMILIES, ALIAS_INDEX, BS5_BREAKPOINTS, BusyDialogComponent, BusyTimer, CANONICAL_ALIASES, ConfirmDialogComponent, CredentialsDialogComponent, DeleteDialogComponent, DeleteDialogConfirmMode, DialogService, FlexLayoutModule, FxClassDirective, FxFlexAlignDirective, FxFlexDirective, FxFlexFillDirective, FxFlexOffsetDirective, FxFlexOrderDirective, FxGridAreaDirective, FxGridColumnDirective, FxGridDirective, FxLayoutAlignDirective, FxLayoutDirective, FxLayoutGapDirective, FxLayoutWrapDirective, FxShowHideDirective, FxStyleDirective, IfBpDirective, InfoDialogComponent, LAYOUT_BREAKPOINTS, LAYOUT_VALUES, MediaObserver, NON_CANONICAL_PRIORITY, OtpInputComponent, PaginatorIntl, PasswordStrengthComponent, RecoverPasswordDialogComponent, ResetPasswordDialogComponent, ResponsiveBaseDirective, ToastComponent, UIService, applyVisibility, buildAlignStyles, buildFlexStyles, buildLayoutCSS, resolve, resolveAll, resolveFlexInput, resolveNonCanonical, resolveParentFlow, validateBasis, validateLayoutValue, validateWrapValue };
1405
1415
  export type { BpValues, BreakpointAlias, CanonicalKey, ConfirmDialogData, ConfirmDialogOption, CredentialsDialogData, CredentialsDialogResult, DeleteDialogData, DialogOption, DialogResult, IDialogService, InfoDialogData, NcValues, NonCanonicalKey, RecoverPasswordDialogData, RecoverPasswordDialogResult, ResetPasswordDialogData, ResetPasswordDialogMode, ResetPasswordDialogResult, ToastData };