@dereekb/dbx-firebase 13.32.0 → 13.34.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.
@@ -6,20 +6,20 @@ import { Observable, switchMap, of, shareReplay, map, Subject, merge, distinctUn
6
6
  import * as i2 from '@dereekb/dbx-core';
7
7
  import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponent, AbstractForwardDbxInjectionContextDirective, DbxInjectionContextDirective, DbxAuthImpersonationDelegate, DbxAuthService, provideDbxAuthImpersonation, DbxActionButtonDirective, completeOnDestroy, cleanSubscription, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxActionAutoTriggerDirective, clean, cleanLoadingContext, provideDbxRouteModelIdDirectiveDelegate, provideDbxRouteModelKeyDirectiveDelegate, AbstractIfDirective, LockSetComponentStore, newWithInjector, DbxActionDisabledDirective, CutTextPipe, DbxActionValueDirective, DbxActionContextStoreSourceInstance, DbxActionHandlerInstance, cleanSubscriptionWithLockSet, DbxButton, SimpleStorageAccessorFactory, dbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance } from '@dereekb/dbx-core';
8
8
  import { onAuthStateChanged, onIdTokenChanged, confirmPasswordReset, sendPasswordResetEmail, signInWithPopup, signInWithRedirect, linkWithPopup, linkWithRedirect, linkWithCredential, unlink, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, reauthenticateWithPopup, reauthenticateWithRedirect, getRedirectResult, OAuthProvider, FacebookAuthProvider, GithubAuthProvider, GoogleAuthProvider, TwitterAuthProvider, getAuth, connectAuthEmulator } from 'firebase/auth';
9
- import { AUTH_ADMIN_ROLE, cachedGetter, urlWithoutParameters, addToSet, removeFromSet, filterMaybeArrayValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, addToSetCopy, iterableToArray, runAsyncTasksForValues, forEachKeyValue, countAllInNestedArray, invertDecision, useIterableOrValue, filterUniqueValues, reverseCompareFn, sortByNumberFunction, separateValues, readableError, isMaybeSo, firstValue, areEqualPOJOValues, MS_IN_SECOND, splitJoinRemainder, MS_IN_HOUR, SECONDS_IN_MINUTE, MS_IN_DAY, unixDateTimeSecondsNumberForNow, MS_IN_MINUTE, addMilliseconds, unixDateTimeSecondsNumberFromDate, dateFromDateOrTimeSecondsNumber, isPast } from '@dereekb/util';
9
+ import { AUTH_ADMIN_ROLE, cachedGetter, urlWithoutParameters, addToSet, removeFromSet, filterMaybeArrayValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, addToSetCopy, iterableToArray, runAsyncTasksForValues, forEachKeyValue, countAllInNestedArray, invertDecision, useIterableOrValue, filterUniqueValues, reverseCompareFn, sortByNumberFunction, separateValues, readableError, isMaybeSo, firstValue, fixExtraQueryParameters, areEqualPOJOValues, MS_IN_SECOND, splitJoinRemainder, MS_IN_HOUR, SECONDS_IN_MINUTE, MS_IN_DAY, unixDateTimeSecondsNumberForNow, MS_IN_MINUTE, addMilliseconds, unixDateTimeSecondsNumberFromDate, dateFromDateOrTimeSecondsNumber, isPast } from '@dereekb/util';
10
10
  import { safeFormatToISO8601DateString, msToSeconds, isSameDate } from '@dereekb/date';
11
11
  import { getToken, initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';
12
12
  import * as i1$1 from '@dereekb/dbx-web';
13
- import { DbxLinkComponent, DbxActionModule, DbxButtonModule, DbxErrorComponent, DbxActionErrorDirective, DbxButtonComponent, DbxButtonSpacerDirective, DbxRouterAnchorModule, DbxSectionComponent, DbxWidgetService, AbstractDbxSelectionListWrapperDirective, DbxListWrapperComponentImportsModule, provideDbxListViewWrapper, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewComponentImportsModule, provideDbxListView, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxValueListViewItemComponent, TwoColumnsContextStore, DbxAnchorComponent, DbxTwoColumnFullLeftDirective, DbxWidgetViewComponent, DbxTwoColumnComponent, DbxTwoBlockComponent, DbxTwoColumnRightComponent, AbstractPopupDirective, DbxPopupService, DbxPopupContentComponent, DbxPopupControlsComponent, DbxModelTypesService, DbxModelTrackerService, allDbxModelViewTrackerEventModelKeys, DbxListItemAnchorModifierDirective, DbxValueListItemModifierDirective, AbstractPopoverDirective, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective, DbxListEmptyContentComponent, AbstractPopoverRefDirective, DbxPopoverService, DbxLoadingComponent, DbxDetailBlockComponent, DbxClickToCopyTextComponent, DbxDownloadTextViewComponent, DbxModelObjectStateService, DbxListViewWrapper, DbxChipDirective, DbxColorDirective, DbxIconTileComponent, DbxActionConfirmDirective, DbxContentPitDirective, AbstractDbxWidgetComponent, AbstractDialogDirective, DbxDialogContentDirective, DbxPopoverInteractionModule, DbxListModifierModule, DbxWebFilePreviewService, DbxActionSnackbarErrorDirective, DbxActionDialogDirective, compressImageFile, DbxFileUploadComponent, DbxPdfMergeEditorStore, PDF_MERGE_RESULT_MIME_TYPE, DbxActionLoadingContextDirective, DbxFileUploadActionSyncDirective } from '@dereekb/dbx-web';
13
+ import { DbxLinkComponent, DbxActionModule, DbxButtonModule, DbxErrorComponent, DbxActionErrorDirective, DbxButtonComponent, DbxButtonSpacerDirective, DbxRouterAnchorModule, DbxSectionComponent, DbxWidgetService, AbstractDbxSelectionListWrapperDirective, DbxListWrapperComponentImportsModule, provideDbxListViewWrapper, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewComponentImportsModule, provideDbxListView, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxValueListViewItemComponent, TwoColumnsContextStore, DbxAnchorComponent, DbxTwoColumnFullLeftDirective, DbxWidgetViewComponent, DbxTwoColumnComponent, DbxTwoBlockComponent, DbxTwoColumnRightComponent, AbstractPopupDirective, DbxPopupService, DbxPopupContentComponent, DbxPopupControlsComponent, DbxModelTypesService, DbxModelTrackerService, allDbxModelViewTrackerEventModelKeys, DbxListItemAnchorModifierDirective, DbxValueListItemModifierDirective, AbstractPopoverDirective, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective, DbxListEmptyContentComponent, AbstractPopoverRefDirective, DbxPopoverService, DbxLoadingComponent, DbxDetailBlockComponent, DbxClickToCopyTextComponent, DbxDownloadTextViewComponent, DbxModelObjectStateService, DbxListViewWrapper, AbstractDbxListWrapperDirective, AbstractDbxListViewDirective, DbxValueListViewComponentImportsModule, DEFAULT_DBX_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, DbxActionConfirmDirective, DbxAvatarComponent, DbxChipDirective, DbxColorDirective, DbxIconTileComponent, DbxContentPitDirective, AbstractDbxWidgetComponent, AbstractDialogDirective, DbxDialogContentDirective, DbxPopoverInteractionModule, DbxListModifierModule, DbxWebFilePreviewService, DbxActionSnackbarErrorDirective, DbxActionDialogDirective, compressImageFile, DbxFileUploadComponent, DbxPdfMergeEditorStore, PDF_MERGE_RESULT_MIME_TYPE, DbxActionLoadingContextDirective, DbxFileUploadActionSyncDirective } from '@dereekb/dbx-web';
14
14
  import * as i1 from '@angular/material/icon';
15
15
  import { MatIconModule, MatIcon } from '@angular/material/icon';
16
- import { firebaseAuthErrorToReadableError, FIREBASE_AUTH_PASSWORD_MIN_LENGTH, FirebaseDevelopmentFunctions, ScheduledFunctionDevelopmentFunctionTypeEnum, clientFirebaseFirestoreContextFactory, SystemStateFirestoreCollections, NotificationFirestoreCollections, StorageFileFirestoreCollections, FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY, iterationQueryDocChangeWatcher, firebaseQuerySnapshotAccumulator, firebaseQueryItemAccumulator, firestoreModelKeysFromDocuments, firestoreModelIdsFromDocuments, documentReferencesFromDocuments, getDocumentSnapshots, getDataFromDocumentSnapshots, latestSnapshotsFromDocuments, dataFromDocumentSnapshots, loadDocumentsForKeys, loadDocumentsForDocumentReferences, loadDocumentsForIds, firestoreModelKeyCollectionTypePair, buildFirebaseCollectionTypeModelTypeMap, firestoreModelId, flatFirestoreModelKey, twoWayFlatFirestoreModelKey, FirestoreAccessorStreamMode, firestoreModelIdsFromKey, firestoreModelKeyPartPairs, firestoreModelKeyPairObject, documentDataWithIdAndKey, isClientFirebaseError, FIRESTORE_PERMISSION_DENIED_ERROR_CODE, inferKeyFromTwoWayFlatFirestoreModelKey, firestoreModelKeyParentKey, NotificationHealthCheckStatus, NotificationDeliveryMethod, MailgunNotificationHealthCheckIssueCode, KnownNotificationHealthCheckIssueCode, AppNotificationTemplateTypeInfoRecordService, NotificationFunctions, notificationUserHealthCheckNextRunAt, notificationUserHealthCheckNextProbeAtByMethod, notificationHealthCheckPendingProbeMethods, notificationUserHealthCheckNextVerifyAt, DEFAULT_NOTIFICATION_USER_HEALTH_CHECK_VERIFY_THROTTLE_SECONDS, ALL_NOTIFICATION_DELIVERY_METHODS, unreadNotificationItems, StorageFileFunctions, firestoreModelKey, storageFileIdentity, clientFirebaseStorageContextFactory } from '@dereekb/firebase';
16
+ import { firebaseAuthErrorToReadableError, FIREBASE_AUTH_PASSWORD_MIN_LENGTH, FirebaseDevelopmentFunctions, ScheduledFunctionDevelopmentFunctionTypeEnum, clientFirebaseFirestoreContextFactory, SystemStateFirestoreCollections, NotificationFirestoreCollections, StorageFileFirestoreCollections, FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY, iterationQueryDocChangeWatcher, firebaseQuerySnapshotAccumulator, firebaseQueryItemAccumulator, firestoreModelKeysFromDocuments, firestoreModelIdsFromDocuments, documentReferencesFromDocuments, getDocumentSnapshots, getDataFromDocumentSnapshots, latestSnapshotsFromDocuments, dataFromDocumentSnapshots, loadDocumentsForKeys, loadDocumentsForDocumentReferences, loadDocumentsForIds, firestoreModelKeyCollectionTypePair, buildFirebaseCollectionTypeModelTypeMap, firestoreModelId, flatFirestoreModelKey, twoWayFlatFirestoreModelKey, FirestoreAccessorStreamMode, firestoreModelIdsFromKey, firestoreModelKeyPartPairs, firestoreModelKeyPairObject, documentDataWithIdAndKey, isClientFirebaseError, FIRESTORE_PERMISSION_DENIED_ERROR_CODE, inferKeyFromTwoWayFlatFirestoreModelKey, firestoreModelKeyParentKey, userExternalConnectionEntryIsConnected, CALCOM_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE, ZOOM_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE, DISCORD_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE, ZOHO_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE, UserExternalConnectionFunctions, NotificationHealthCheckStatus, NotificationDeliveryMethod, MailgunNotificationHealthCheckIssueCode, KnownNotificationHealthCheckIssueCode, AppNotificationTemplateTypeInfoRecordService, NotificationFunctions, notificationUserHealthCheckNextRunAt, notificationUserHealthCheckNextProbeAtByMethod, notificationHealthCheckPendingProbeMethods, notificationUserHealthCheckNextVerifyAt, DEFAULT_NOTIFICATION_USER_HEALTH_CHECK_VERIFY_THROTTLE_SECONDS, ALL_NOTIFICATION_DELIVERY_METHODS, unreadNotificationItems, StorageFileFunctions, firestoreModelKey, storageFileIdentity, clientFirebaseStorageContextFactory } from '@dereekb/firebase';
17
17
  import * as i1$2 from '@dereekb/dbx-form';
18
18
  import { AbstractSyncForgeFormDirective, dbxForgeEmailField, DbxForgeFormComponentImportsModule, dbxForgeFormComponentProviders, DBX_FORGE_FORM_COMPONENT_TEMPLATE, AbstractConfigAsyncForgeFormDirective, dbxForgeUsernameLoginField, dbxForgeTextPasswordField, dbxForgeTextVerifyPasswordField, DbxActionFormDirective, DbxFormSourceDirective, dbxForgeTextPasswordWithVerifyField, dbxForgeTextField, dbxForgePickableChipField, filterPickableItemFieldValuesByLabel } from '@dereekb/dbx-form';
19
19
  import { NgTemplateOutlet, DatePipe } from '@angular/common';
20
20
  import * as i1$3 from '@angular/material/button';
21
21
  import { MatButtonModule } from '@angular/material/button';
22
- import { toSignal, toObservable } from '@angular/core/rxjs-interop';
22
+ import { toSignal, toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
23
23
  import { MatSnackBar } from '@angular/material/snack-bar';
24
24
  import { initializeApp } from 'firebase/app';
25
25
  import { persistentSingleTabManager, persistentMultipleTabManager, persistentLocalCache, initializeFirestore, connectFirestoreEmulator } from 'firebase/firestore';
@@ -6262,6 +6262,1031 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
6262
6262
  }]
6263
6263
  }] });
6264
6264
 
6265
+ /**
6266
+ * Configuration for the external connection registry.
6267
+ *
6268
+ * Declared as an abstract class so it is its own injection token (the newer style, as
6269
+ * `DbxFirebaseOidcConfig`). Unlike login there is no library-supplied default catalog for an
6270
+ * `InjectionToken`-with-`useFactory` shape to override, and the registry needs more than a list.
6271
+ */
6272
+ class DbxFirebaseExternalConnectionsConfig {
6273
+ /**
6274
+ * Which providers are enabled. Pass `true` (the default) to enable every registered provider.
6275
+ */
6276
+ enabledProviders;
6277
+ /**
6278
+ * Whether the connect flow mints a signed `state` and carries it on the authorize request.
6279
+ * Defaults to true.
6280
+ *
6281
+ * This is what identifies the connecting user to the server, since a top-level navigation carries
6282
+ * no Firebase ID token: the app's own authorize endpoint bounces a stateless request straight to
6283
+ * the failure url. Turn it off only for an endpoint that mints its own state, and note that doing
6284
+ * so means no authenticated call is made before the redirect.
6285
+ */
6286
+ mintAuthorizeState;
6287
+ /**
6288
+ * Origin the authorize paths are resolved against (e.g. the hosting origin that fronts the API).
6289
+ *
6290
+ * When undefined the authorize path is used as-is, which is the correct behavior when the app and
6291
+ * the OAuth controller share an origin.
6292
+ */
6293
+ authorizeOrigin;
6294
+ /**
6295
+ * Builds the default authorize path for a provider that does not declare its own.
6296
+ *
6297
+ * Defaults to {@link DEFAULT_EXTERNAL_CONNECTION_AUTHORIZE_PATH_FACTORY}.
6298
+ */
6299
+ authorizePathFactory;
6300
+ /**
6301
+ * Navigation seam used by the default connect behavior.
6302
+ *
6303
+ * Defaults to {@link DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_FUNCTION}. An override owns the same
6304
+ * contract: settle only once the new page is actually opening.
6305
+ */
6306
+ navigate;
6307
+ }
6308
+ /**
6309
+ * Default authorize path for a provider: `/oauth/<providerType>/authorize`.
6310
+ *
6311
+ * @param providerType - The provider to build a path for.
6312
+ * @returns The authorize path.
6313
+ */
6314
+ const DEFAULT_EXTERNAL_CONNECTION_AUTHORIZE_PATH_FACTORY = (providerType) => `/oauth/${providerType}/authorize`;
6315
+ /**
6316
+ * Derives a row's presentation status from its entry.
6317
+ *
6318
+ * @param entry - The user's entry for the provider, if any.
6319
+ * @returns The row status.
6320
+ */
6321
+ function dbxFirebaseExternalConnectionRowStatusForEntry(entry) {
6322
+ let result;
6323
+ if (userExternalConnectionEntryIsConnected(entry)) {
6324
+ result = 'connected';
6325
+ }
6326
+ else if (entry?.st === 'error') {
6327
+ result = 'error';
6328
+ }
6329
+ else {
6330
+ result = 'notConnected';
6331
+ }
6332
+ return result;
6333
+ }
6334
+ /**
6335
+ * Builds the rows to render.
6336
+ *
6337
+ * The row set is the union of the enabled providers and any registered provider the user still has
6338
+ * an entry for, so a provider that has since been disabled can still be disconnected.
6339
+ *
6340
+ * @param input - The registry state plus the user's entries.
6341
+ * @returns The rows, in registration order.
6342
+ */
6343
+ function dbxFirebaseExternalConnectionRows(input) {
6344
+ const { providers, enabledProviderTypes, entries, loading } = input;
6345
+ const enabled = new Set(enabledProviderTypes);
6346
+ return providers
6347
+ .filter((x) => enabled.has(x.providerType) || entries?.[x.providerType] != null)
6348
+ .map((provider) => {
6349
+ const entry = entries?.[provider.providerType];
6350
+ return {
6351
+ providerType: provider.providerType,
6352
+ assets: provider.assets,
6353
+ entry,
6354
+ status: loading ? 'loading' : dbxFirebaseExternalConnectionRowStatusForEntry(entry),
6355
+ enabled: enabled.has(provider.providerType)
6356
+ };
6357
+ });
6358
+ }
6359
+
6360
+ /**
6361
+ * Default presentation for Cal.com.
6362
+ *
6363
+ * `icon` is a Material Symbols name throughout these defaults: the brand logo set the login registry
6364
+ * pulls from covers Firebase's own auth providers only, so a real mark for any of these services
6365
+ * would need a new asset. An app that has one passes `assets.logoUrl` instead.
6366
+ */
6367
+ const DBX_FIREBASE_EXTERNAL_CONNECTION_CALCOM_PROVIDER = {
6368
+ providerType: CALCOM_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE,
6369
+ assets: {
6370
+ providerName: 'Cal.com',
6371
+ icon: 'event',
6372
+ description: 'Schedule and manage bookings from your Cal.com account.'
6373
+ }
6374
+ };
6375
+ /**
6376
+ * Default presentation for Zoom.
6377
+ */
6378
+ const DBX_FIREBASE_EXTERNAL_CONNECTION_ZOOM_PROVIDER = {
6379
+ providerType: ZOOM_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE,
6380
+ assets: {
6381
+ providerName: 'Zoom',
6382
+ icon: 'videocam',
6383
+ description: 'Create and manage Zoom meetings.'
6384
+ }
6385
+ };
6386
+ /**
6387
+ * Default presentation for Discord.
6388
+ */
6389
+ const DBX_FIREBASE_EXTERNAL_CONNECTION_DISCORD_PROVIDER = {
6390
+ providerType: DISCORD_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE,
6391
+ assets: {
6392
+ providerName: 'Discord',
6393
+ icon: 'forum',
6394
+ description: 'Link your Discord account.'
6395
+ }
6396
+ };
6397
+ /**
6398
+ * Default presentation for Zoho.
6399
+ */
6400
+ const DBX_FIREBASE_EXTERNAL_CONNECTION_ZOHO_PROVIDER = {
6401
+ providerType: ZOHO_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE,
6402
+ assets: {
6403
+ providerName: 'Zoho',
6404
+ icon: 'work',
6405
+ description: 'Connect your Zoho account.'
6406
+ }
6407
+ };
6408
+ /**
6409
+ * The library's provider for each known third-party service, keyed by provider type.
6410
+ *
6411
+ * Every service the workspace ships a server-side OAuth adapter for appears here, so an app that
6412
+ * mounts one of those controllers has nothing to declare on the client beyond naming it.
6413
+ */
6414
+ const DBX_FIREBASE_KNOWN_EXTERNAL_CONNECTION_PROVIDERS = {
6415
+ calcom: DBX_FIREBASE_EXTERNAL_CONNECTION_CALCOM_PROVIDER,
6416
+ zoom: DBX_FIREBASE_EXTERNAL_CONNECTION_ZOOM_PROVIDER,
6417
+ discord: DBX_FIREBASE_EXTERNAL_CONNECTION_DISCORD_PROVIDER,
6418
+ zoho: DBX_FIREBASE_EXTERNAL_CONNECTION_ZOHO_PROVIDER
6419
+ };
6420
+ /**
6421
+ * Builds a provider from a known one, with the given overrides applied.
6422
+ *
6423
+ * @param config - The known provider to start from, plus the values to override.
6424
+ * @returns The provider to register.
6425
+ * @throws {Error} When there is no known provider for the given type.
6426
+ */
6427
+ function dbxFirebaseKnownExternalConnectionProvider(config) {
6428
+ const { providerType, assets, authorizePath, connect, disconnectConfirm } = config;
6429
+ const known = DBX_FIREBASE_KNOWN_EXTERNAL_CONNECTION_PROVIDERS[providerType];
6430
+ if (known == null) {
6431
+ throw new Error(`dbxFirebaseKnownExternalConnectionProvider(): there is no known provider for "${providerType}".`);
6432
+ }
6433
+ return {
6434
+ ...known,
6435
+ assets: { ...known.assets, ...assets },
6436
+ authorizePath: authorizePath ?? known.authorizePath,
6437
+ connect: connect ?? known.connect,
6438
+ disconnectConfirm: disconnectConfirm ?? known.disconnectConfirm
6439
+ };
6440
+ }
6441
+ /**
6442
+ * Resolves a configured entry to the provider to register.
6443
+ *
6444
+ * @param entry - A known provider type, or a fully-declared provider.
6445
+ * @returns The provider to register.
6446
+ * @throws {Error} When the entry names a provider type the library has no defaults for.
6447
+ */
6448
+ function dbxFirebaseExternalConnectionProviderForEntry(entry) {
6449
+ let result;
6450
+ if (typeof entry === 'string') {
6451
+ const known = DBX_FIREBASE_KNOWN_EXTERNAL_CONNECTION_PROVIDERS[entry];
6452
+ if (known == null) {
6453
+ throw new Error(`dbxFirebaseExternalConnectionProviderForEntry(): there is no known provider for "${entry}". Declare the provider instead of naming it.`);
6454
+ }
6455
+ result = known;
6456
+ }
6457
+ else {
6458
+ result = entry;
6459
+ }
6460
+ return result;
6461
+ }
6462
+
6463
+ /**
6464
+ * How long {@link DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_FUNCTION} waits for the browser to leave the
6465
+ * page before treating the redirect as having failed.
6466
+ *
6467
+ * Generous, because the wait spans the request to the app's own authorize endpoint plus the redirect
6468
+ * chain out to the provider, and a cold serverless function alone can take several seconds.
6469
+ */
6470
+ const DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_TIMEOUT = 20 * 1000;
6471
+ /**
6472
+ * Starts a top-level navigation and resolves only once the browser has committed to leaving the
6473
+ * current page, rejecting when it has not done so within the timeout.
6474
+ *
6475
+ * `pagehide` is the signal: it fires as the browser is about to unload this document for the new one,
6476
+ * which is the earliest point the navigation is known to have actually taken. Anything earlier — an
6477
+ * assignment to `location.href` returning, say — only says the navigation was *requested*.
6478
+ *
6479
+ * The navigation is invoked here rather than by the caller so the listener is always in place before
6480
+ * the page can go, and so a refused navigation settles immediately instead of waiting out the timeout.
6481
+ *
6482
+ * @param navigate - Starts the navigation.
6483
+ * @param timeout - How long to wait before rejecting. Defaults to {@link DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_TIMEOUT}.
6484
+ * @returns Resolves when the page is being unloaded for the navigation.
6485
+ */
6486
+ function navigateAndWaitForPageToLeave(navigate, timeout = DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_TIMEOUT) {
6487
+ return new Promise((resolve, reject) => {
6488
+ // aborting drops the listener, so a page that stays put does not accumulate one per attempt
6489
+ const abortController = new AbortController();
6490
+ const timeoutRef = setTimeout(() => {
6491
+ abortController.abort();
6492
+ reject(new Error('The page did not open. The browser may have blocked the redirect.'));
6493
+ }, timeout);
6494
+ const cancel = () => {
6495
+ abortController.abort();
6496
+ clearTimeout(timeoutRef);
6497
+ };
6498
+ window.addEventListener('pagehide', () => {
6499
+ clearTimeout(timeoutRef);
6500
+ resolve();
6501
+ }, { once: true, signal: abortController.signal });
6502
+ try {
6503
+ navigate();
6504
+ }
6505
+ catch (e) {
6506
+ cancel();
6507
+ reject(e);
6508
+ }
6509
+ });
6510
+ }
6511
+ /**
6512
+ * Default navigation: a top-level browser redirect that settles only once the new page is opening.
6513
+ *
6514
+ * Assigning `location.href` returns immediately — before the request for the new document has even
6515
+ * been answered — so a caller that treated the assignment as the end of the work reported success
6516
+ * while the old page was still sitting there. Waiting for the unload instead means the connect action
6517
+ * stays in its working state for as long as the user is still looking at the settings page, and a
6518
+ * redirect the browser refuses outright surfaces as an error rather than a silent success.
6519
+ *
6520
+ * @param url - The url to navigate to.
6521
+ * @returns Resolves once the browser is leaving the page for the new url.
6522
+ */
6523
+ const DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_FUNCTION = (url) => {
6524
+ return navigateAndWaitForPageToLeave(() => {
6525
+ window.location.href = url;
6526
+ });
6527
+ };
6528
+ /**
6529
+ * Registry of the third-party services a user can connect their account to.
6530
+ *
6531
+ * Modeled on `DbxFirebaseAuthLoginService`, but WITHOUT any per-user state: it is root-scoped, so a
6532
+ * Firestore listener held here would live for the app's lifetime and lock the UI to one user. The
6533
+ * connection state is resolved by the container component instead, from a single document read that
6534
+ * is fanned out to every row.
6535
+ */
6536
+ class DbxFirebaseExternalConnectionService {
6537
+ config = inject(DbxFirebaseExternalConnectionsConfig);
6538
+ /**
6539
+ * Optional so the registry is usable — and testable — in an app that has not wired the
6540
+ * userExternalConnection callables. Only state minting needs them, and it says so when they are
6541
+ * missing rather than failing every injection of this service.
6542
+ */
6543
+ _userExternalConnectionFunctions = inject(UserExternalConnectionFunctions, { optional: true });
6544
+ _providers = new Map();
6545
+ _assets = new Map();
6546
+ _enableAll = false;
6547
+ _enabled = new Set();
6548
+ constructor() {
6549
+ const { providers, enabledProviders } = this.config;
6550
+ providers.forEach((x) => this.register(dbxFirebaseExternalConnectionProviderForEntry(x), false));
6551
+ if (enabledProviders == null || enabledProviders === true) {
6552
+ this._enableAll = true;
6553
+ }
6554
+ else {
6555
+ this.enable(enabledProviders);
6556
+ }
6557
+ }
6558
+ /**
6559
+ * Registers a provider.
6560
+ *
6561
+ * @param provider - The provider to register.
6562
+ * @param override - Whether to override an existing provider of the same type. Defaults to true.
6563
+ * @returns True if the provider was registered.
6564
+ */
6565
+ register(provider, override = true) {
6566
+ let result;
6567
+ if (override || !this._providers.has(provider.providerType)) {
6568
+ this._providers.set(provider.providerType, provider);
6569
+ this.updateAssetsForProvider(provider.providerType, provider.assets);
6570
+ result = true;
6571
+ }
6572
+ else {
6573
+ result = false;
6574
+ }
6575
+ return result;
6576
+ }
6577
+ /**
6578
+ * Patches the assets for a provider type.
6579
+ *
6580
+ * @param providerType - The provider to update.
6581
+ * @param assets - The asset values to merge in.
6582
+ */
6583
+ updateAssetsForProvider(providerType, assets) {
6584
+ const current = this._assets.get(providerType);
6585
+ this._assets.set(providerType, { ...current, ...assets });
6586
+ }
6587
+ // MARK: Enable/Disable
6588
+ /**
6589
+ * Enables all providers, including any registered later.
6590
+ *
6591
+ * @param enableAll - Whether to enable all providers. Defaults to true.
6592
+ */
6593
+ setEnableAll(enableAll = true) {
6594
+ this._enableAll = enableAll;
6595
+ }
6596
+ clearEnabled() {
6597
+ this._enabled = new Set();
6598
+ }
6599
+ enable(types) {
6600
+ addToSet(this._enabled, types);
6601
+ }
6602
+ disable(types) {
6603
+ removeFromSet(this._enabled, types);
6604
+ }
6605
+ // MARK: Get
6606
+ getRegisteredTypes() {
6607
+ return [...this._providers.keys()];
6608
+ }
6609
+ getEnabledTypes() {
6610
+ return this._enableAll ? this.getRegisteredTypes() : [...this._enabled];
6611
+ }
6612
+ getProvider(providerType) {
6613
+ return this._providers.get(providerType);
6614
+ }
6615
+ getProviders(types) {
6616
+ return filterMaybeArrayValues(mapIterable(types ?? this.getRegisteredTypes(), (x) => this._providers.get(x)));
6617
+ }
6618
+ getAssetsForProvider(providerType) {
6619
+ return this._assets.get(providerType);
6620
+ }
6621
+ // MARK: Connect
6622
+ /**
6623
+ * Whether the connect flow mints a signed `state` and carries it on the authorize request.
6624
+ *
6625
+ * @returns True when state minting is enabled, which is the default.
6626
+ */
6627
+ get mintsAuthorizeState() {
6628
+ return this.config.mintAuthorizeState ?? true;
6629
+ }
6630
+ /**
6631
+ * Mints the short-lived signed `state` that begins a provider's OAuth handoff.
6632
+ *
6633
+ * An AUTHENTICATED call, which is the entire point of it: the top-level navigation that follows
6634
+ * carries no Firebase ID token, so this is the only place the server learns who is connecting.
6635
+ *
6636
+ * Requires the user to already have a connection document — the server asserts a role against it,
6637
+ * and a role map is only consulted for a document that exists. `DbxFirebaseExternalConnectionsComponent`
6638
+ * creates it on load; a custom UI that reaches this call by another route has to create it too.
6639
+ *
6640
+ * @param providerType - The provider the state is for.
6641
+ * @returns The state to send on the authorize request.
6642
+ */
6643
+ async mintAuthorizeStateForProvider(providerType) {
6644
+ const userExternalConnectionFunctions = this._userExternalConnectionFunctions;
6645
+ if (!userExternalConnectionFunctions) {
6646
+ throw new Error(`DbxFirebaseExternalConnectionService: cannot mint an authorize state for "${providerType}" because UserExternalConnectionFunctions was not provided. Add the userExternalConnection functions to the app's functions config map, or configure mintAuthorizeState: false.`);
6647
+ }
6648
+ const { state } = await userExternalConnectionFunctions.userExternalConnection.readUserExternalConnection.authorizeState({ providerType });
6649
+ return state;
6650
+ }
6651
+ /**
6652
+ * Resolves the authorize url for a provider, carrying a freshly minted `state` when state minting
6653
+ * is enabled.
6654
+ *
6655
+ * @param providerType - The provider to resolve.
6656
+ * @returns The authorize url, or null when the provider is not registered.
6657
+ */
6658
+ async authorizeUrlWithStateForProvider(providerType) {
6659
+ const authorizeUrl = this.authorizeUrlForProvider(providerType);
6660
+ let result = authorizeUrl;
6661
+ if (authorizeUrl && this.mintsAuthorizeState) {
6662
+ const state = await this.mintAuthorizeStateForProvider(providerType);
6663
+ // appended as text rather than through URL, since an app that shares an origin with its API
6664
+ // configures no authorizeOrigin and the path stays relative
6665
+ result = fixExtraQueryParameters(`${authorizeUrl}?state=${encodeURIComponent(state)}`);
6666
+ }
6667
+ return result;
6668
+ }
6669
+ /**
6670
+ * Resolves the authorize url for a provider, WITHOUT a `state`.
6671
+ *
6672
+ * @param providerType - The provider to resolve.
6673
+ * @returns The authorize url, or null when the provider is not registered.
6674
+ */
6675
+ authorizeUrlForProvider(providerType) {
6676
+ const provider = this.getProvider(providerType);
6677
+ let result = null;
6678
+ if (provider) {
6679
+ const pathFactory = this.config.authorizePathFactory ?? DEFAULT_EXTERNAL_CONNECTION_AUTHORIZE_PATH_FACTORY;
6680
+ const path = provider.authorizePath ?? pathFactory(providerType);
6681
+ result = this.config.authorizeOrigin ? `${this.config.authorizeOrigin}${path}` : path;
6682
+ }
6683
+ return result;
6684
+ }
6685
+ /**
6686
+ * Starts the connect flow for a provider.
6687
+ *
6688
+ * Uses the provider's own `connect` handler when it declares one, otherwise mints the `state` and
6689
+ * navigates to the authorize url carrying it. The mint is deliberately part of the default rather
6690
+ * than something each app re-implements: the app's authorize endpoint bounces a stateless request
6691
+ * straight to its failure url, so a "connect" that skipped it would look like it worked and land
6692
+ * the user back on the settings page unconnected.
6693
+ *
6694
+ * @param providerType - The provider to connect.
6695
+ * @returns Resolves once the authorize page is actually opening, and rejects when it never opened.
6696
+ */
6697
+ async connectToProvider(providerType) {
6698
+ const provider = this.getProvider(providerType);
6699
+ if (!provider) {
6700
+ throw new Error(`DbxFirebaseExternalConnectionService: no provider registered for "${providerType}".`);
6701
+ }
6702
+ const navigate = this.config.navigate ?? DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_FUNCTION;
6703
+ if (provider.connect) {
6704
+ await provider.connect({
6705
+ providerType,
6706
+ provider,
6707
+ authorizeUrl: this.authorizeUrlForProvider(providerType),
6708
+ mintAuthorizeState: () => this.mintAuthorizeStateForProvider(providerType),
6709
+ navigate
6710
+ });
6711
+ }
6712
+ else {
6713
+ const authorizeUrl = await this.authorizeUrlWithStateForProvider(providerType);
6714
+ if (!authorizeUrl) {
6715
+ throw new Error(`DbxFirebaseExternalConnectionService: no authorize url could be resolved for "${providerType}".`);
6716
+ }
6717
+ await navigate(authorizeUrl);
6718
+ }
6719
+ }
6720
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6721
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionService });
6722
+ }
6723
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionService, decorators: [{
6724
+ type: Injectable
6725
+ }], ctorParameters: () => [] });
6726
+
6727
+ /**
6728
+ * Injection token for the app's UserExternalConnection collection.
6729
+ *
6730
+ * The model's own `UserExternalConnectionFirestoreCollections` is an interface (the canonical model
6731
+ * folder shape) and so cannot be an Angular injection token. This abstract class is that token, and
6732
+ * is bound to the app's collections class by `provideDbxFirebaseExternalConnections()`.
6733
+ */
6734
+ class DbxFirebaseUserExternalConnectionCollections {
6735
+ }
6736
+ /**
6737
+ * Document store for the signed-in user's single UserExternalConnection document.
6738
+ *
6739
+ * The document id IS the user's uid, so this store is keyed with `setId(currentUid$)`.
6740
+ */
6741
+ class UserExternalConnectionDocumentStore extends AbstractDbxFirebaseDocumentStore {
6742
+ userExternalConnectionFunctions = inject(UserExternalConnectionFunctions);
6743
+ constructor() {
6744
+ super({ firestoreCollection: inject(DbxFirebaseUserExternalConnectionCollections).userExternalConnectionCollection });
6745
+ }
6746
+ /**
6747
+ * Creates the user's connection document.
6748
+ *
6749
+ * Required before any provider can be connected: the server asserts a role against this document,
6750
+ * and a role map is only consulted for a document that exists. Throws when the user already has
6751
+ * one, so call it only for a user known not to.
6752
+ */
6753
+ createUserExternalConnection = firebaseDocumentStoreCreateFunction(this, this.userExternalConnectionFunctions.userExternalConnection.createUserExternalConnection);
6754
+ /**
6755
+ * Disconnects the user from a provider. The only write a client can make to the connection pair.
6756
+ */
6757
+ disconnectUserExternalConnection = firebaseDocumentStoreUpdateFunction(this, this.userExternalConnectionFunctions.userExternalConnection.updateUserExternalConnection.disconnect);
6758
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: UserExternalConnectionDocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6759
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: UserExternalConnectionDocumentStore });
6760
+ }
6761
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: UserExternalConnectionDocumentStore, decorators: [{
6762
+ type: Injectable
6763
+ }], ctorParameters: () => [] });
6764
+
6765
+ /**
6766
+ * Directive providing a {@link UserExternalConnectionDocumentStore} for a single user's connection document.
6767
+ */
6768
+ class DbxFirebaseUserExternalConnectionDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective {
6769
+ constructor() {
6770
+ super(inject(UserExternalConnectionDocumentStore));
6771
+ }
6772
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseUserExternalConnectionDocumentStoreDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
6773
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: DbxFirebaseUserExternalConnectionDocumentStoreDirective, isStandalone: true, selector: "[dbxFirebaseUserExternalConnectionDocument]", providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseUserExternalConnectionDocumentStoreDirective, UserExternalConnectionDocumentStore), usesInheritance: true, ngImport: i0 });
6774
+ }
6775
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseUserExternalConnectionDocumentStoreDirective, decorators: [{
6776
+ type: Directive,
6777
+ args: [{
6778
+ selector: '[dbxFirebaseUserExternalConnectionDocument]',
6779
+ providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseUserExternalConnectionDocumentStoreDirective, UserExternalConnectionDocumentStore),
6780
+ standalone: true
6781
+ }]
6782
+ }], ctorParameters: () => [] });
6783
+
6784
+ /**
6785
+ * Maps the document store's loading state into the per-provider entry map the UI renders from.
6786
+ *
6787
+ * This mapper exists because `dataLoadingState$` turns a MISSING document into
6788
+ * `errorResult(modelDoesNotExistError())` — and a user who has never connected anything has no
6789
+ * document, which is the common case, not an error. `exists$` catches `permission-denied` but does
6790
+ * not feed `dataLoadingState$`, so that case has to be handled here too.
6791
+ *
6792
+ * Both cases mean the same thing to this UI: an empty connection map.
6793
+ *
6794
+ * Pure and exported so it is unit-testable without a TestBed.
6795
+ *
6796
+ * @param state - The document store's data loading state.
6797
+ * @returns The loading state of the user's entry map.
6798
+ */
6799
+ function externalConnectionsLoadingStateFromDocumentLoadingState(state) {
6800
+ const errorCode = state.error?.code;
6801
+ let result;
6802
+ if (state.value) {
6803
+ result = successResult(state.value.e ?? {});
6804
+ }
6805
+ else if (errorCode === DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR || errorCode === FIRESTORE_PERMISSION_DENIED_ERROR_CODE) {
6806
+ result = successResult({});
6807
+ }
6808
+ else if (state.error) {
6809
+ result = { ...state, value: undefined };
6810
+ }
6811
+ else {
6812
+ result = { ...state, value: undefined };
6813
+ }
6814
+ return result;
6815
+ }
6816
+ /**
6817
+ * Decides whether a document load means the user has no connection document and needs one created.
6818
+ *
6819
+ * Only a definitive does-not-exist counts. A state that is still loading carries no value and would
6820
+ * otherwise read as missing — creating on it would fail for every user who does have a document. A
6821
+ * denied read is a rules problem rather than an absent document, so it does not create either.
6822
+ *
6823
+ * Pure and exported so it is unit-testable without a TestBed.
6824
+ *
6825
+ * @param state - The document store's data loading state.
6826
+ * @returns True when the document is known not to exist.
6827
+ */
6828
+ function shouldCreateUserExternalConnectionForDocumentLoadingState(state) {
6829
+ return !isLoadingStateLoading(state) && state.value == null && state.error?.code === DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR;
6830
+ }
6831
+ /**
6832
+ * Derived state for the signed-in user's external connections.
6833
+ *
6834
+ * Holds THE shared subscription: one document read fanned out to every provider row, instead of one
6835
+ * read per provider. That is the payoff of collapsing to a single document per user.
6836
+ */
6837
+ class DbxFirebaseUserExternalConnectionsStore {
6838
+ userExternalConnectionDocumentStore = inject(UserExternalConnectionDocumentStore);
6839
+ /**
6840
+ * The user's per-provider entries. A missing document (or a denied read) resolves to an empty map.
6841
+ */
6842
+ entriesLoadingState$ = this.userExternalConnectionDocumentStore.dataLoadingState$.pipe(map(externalConnectionsLoadingStateFromDocumentLoadingState), shareReplay(1));
6843
+ /**
6844
+ * Creates the user's connection document if they do not have one, and does nothing if they do.
6845
+ *
6846
+ * Waits for a settled load before deciding, because a loading state carries no value and would
6847
+ * otherwise read as "missing" for a user who does have a document. Only the definitive
6848
+ * does-not-exist error creates: a denied read is a rules problem, not an absent document.
6849
+ *
6850
+ * The create runs through the document store, so a rejection (including losing the race with
6851
+ * another tab, which the server reports as already-exists) arrives as `error` on the returned
6852
+ * loading state rather than as a thrown error.
6853
+ *
6854
+ * @returns The loading state of the create, or a state with no value when one already exists.
6855
+ */
6856
+ createIfMissing() {
6857
+ return this.userExternalConnectionDocumentStore.dataLoadingState$.pipe(filter((x) => !isLoadingStateLoading(x)), first(), switchMap((state) => (shouldCreateUserExternalConnectionForDocumentLoadingState(state) ? this.userExternalConnectionDocumentStore.createUserExternalConnection({}) : of(undefined))));
6858
+ }
6859
+ /**
6860
+ * Sets the uid whose connection document is loaded. The document id IS the uid.
6861
+ *
6862
+ * @param uid - The uid, or an observable of it. Null clears the loaded document.
6863
+ */
6864
+ setUid(uid) {
6865
+ this.userExternalConnectionDocumentStore.setId(uid);
6866
+ }
6867
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseUserExternalConnectionsStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6868
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseUserExternalConnectionsStore });
6869
+ }
6870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseUserExternalConnectionsStore, decorators: [{
6871
+ type: Injectable
6872
+ }] });
6873
+
6874
+ const CONNECTION_STATUS_LABELS = {
6875
+ loading: 'Loading',
6876
+ connected: 'Connected',
6877
+ notConnected: 'Not connected',
6878
+ error: 'Needs attention'
6879
+ };
6880
+ const CONNECTION_STATUS_COLORS = {
6881
+ loading: 'grey',
6882
+ connected: 'success',
6883
+ notConnected: 'grey',
6884
+ error: 'warn'
6885
+ };
6886
+ /**
6887
+ * Fallback icon for a provider whose assets declare neither a logo nor an icon.
6888
+ */
6889
+ const DEFAULT_CONNECTION_ICON = 'link';
6890
+ /**
6891
+ * Used by actions that declare no confirm config, such as Connect, so they run without a dialog.
6892
+ *
6893
+ * The directive prompts with its defaults for a nullish config, which is not what an action with nothing to
6894
+ * confirm wants.
6895
+ */
6896
+ const AUTO_CONFIRM_CONFIG = { autoConfirm: true };
6897
+ /**
6898
+ * Renders every third-party connection as a card row.
6899
+ *
6900
+ * Composed list utilities (see `DocProgressItemListComponent` for the same recipe):
6901
+ * - `.dbx-list-card-items-list` paints each row as a tinted, rounded card;
6902
+ * - `.dbx-list-no-hover-effects` drops the hover state layer, since a row is not clickable — only its buttons are;
6903
+ * - `.dbx-list-auto-height` lets the list flow inline inside the settings section rather than filling it.
6904
+ *
6905
+ * @example
6906
+ * ```html
6907
+ * <dbx-firebase-external-connection-list [state]="listStateSignal()"></dbx-firebase-external-connection-list>
6908
+ * ```
6909
+ */
6910
+ class DbxFirebaseExternalConnectionListComponent extends AbstractDbxListWrapperDirective {
6911
+ constructor() {
6912
+ super({
6913
+ componentClass: DbxFirebaseExternalConnectionListViewComponent
6914
+ });
6915
+ }
6916
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6917
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: DbxFirebaseExternalConnectionListComponent, isStandalone: true, selector: "dbx-firebase-external-connection-list", host: { classAttribute: "dbx-firebase-external-connection-list dbx-list-auto-height dbx-list-card-items-list dbx-list-no-hover-effects" }, usesInheritance: true, ngImport: i0, template: "\n <dbx-list [state]=\"currentState$\" [config]=\"configSignal()\" [hasMore]=\"hasMore()\" [disabled]=\"disabledSignal()\" [selectionMode]=\"selectionModeSignal()\">\n <ng-content top select=\"[top]\"></ng-content>\n <ng-content bottom select=\"[bottom]\"></ng-content>\n <ng-content empty select=\"[empty]\"></ng-content>\n <ng-content emptyLoading select=\"[emptyLoading]\"></ng-content>\n <ng-content end select=\"[end]\"></ng-content>\n </dbx-list>", isInline: true, dependencies: [{ kind: "ngmodule", type: DbxListWrapperComponentImportsModule }, { kind: "component", type: i1$1.DbxListComponent, selector: "dbx-list", inputs: ["padded", "state", "config", "disabled", "selectionMode", "hasMore"], outputs: ["contentScrolled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6918
+ }
6919
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionListComponent, decorators: [{
6920
+ type: Component,
6921
+ args: [{
6922
+ selector: 'dbx-firebase-external-connection-list',
6923
+ template: DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE,
6924
+ imports: [DbxListWrapperComponentImportsModule],
6925
+ host: {
6926
+ class: 'dbx-firebase-external-connection-list dbx-list-auto-height dbx-list-card-items-list dbx-list-no-hover-effects'
6927
+ },
6928
+ standalone: true,
6929
+ changeDetection: ChangeDetectionStrategy.OnPush
6930
+ }]
6931
+ }], ctorParameters: () => [] });
6932
+ class DbxFirebaseExternalConnectionListViewComponent extends AbstractDbxListViewDirective {
6933
+ config = {
6934
+ componentClass: DbxFirebaseExternalConnectionListViewItemComponent,
6935
+ mapValuesToItemValues: (values) => of(values.map((value) => ({
6936
+ ...value,
6937
+ itemValue: value,
6938
+ // the template paints its own leading avatar, so the built-in icon slot stays empty
6939
+ icon: undefined,
6940
+ // The key carries the row's rendered state, not just its identity. An item value reaches its
6941
+ // component through the injected DBX_VALUE_LIST_VIEW_ITEM provider, and
6942
+ // `dbxInjectionComponentConfigIsEqual` deliberately ignores the provider array — so under a
6943
+ // stable key the component is never recreated and would keep rendering the state it was built
6944
+ // with. Here that would pin every row to its initial 'loading' status forever.
6945
+ key: `${value.row.providerType}_${value.row.status}_${value.row.entry?.uat?.getTime() ?? 0}`
6946
+ })))
6947
+ };
6948
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionListViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
6949
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: DbxFirebaseExternalConnectionListViewComponent, isStandalone: true, selector: "dbx-firebase-external-connection-list-view", host: { classAttribute: "dbx-list-item-p0" }, providers: provideDbxListView(DbxFirebaseExternalConnectionListViewComponent), usesInheritance: true, ngImport: i0, template: "<dbx-list-view [config]=\"config\"></dbx-list-view>", isInline: true, dependencies: [{ kind: "ngmodule", type: DbxValueListViewComponentImportsModule }, { kind: "component", type: i1$1.DbxValueListViewComponent, selector: "dbx-list-view" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6950
+ }
6951
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionListViewComponent, decorators: [{
6952
+ type: Component,
6953
+ args: [{
6954
+ selector: 'dbx-firebase-external-connection-list-view',
6955
+ template: DEFAULT_DBX_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE,
6956
+ imports: [DbxValueListViewComponentImportsModule],
6957
+ providers: provideDbxListView(DbxFirebaseExternalConnectionListViewComponent),
6958
+ host: {
6959
+ // the item template owns all of its padding, including the leading avatar's inset
6960
+ class: 'dbx-list-item-p0'
6961
+ },
6962
+ standalone: true,
6963
+ changeDetection: ChangeDetectionStrategy.OnPush
6964
+ }]
6965
+ }] });
6966
+ /**
6967
+ * One third-party connection: its brand, its current state for the signed-in user, and the actions available for it.
6968
+ *
6969
+ * Presentational — the row and its actions arrive as the injected list item, built by the container that reads every
6970
+ * provider's state from ONE document.
6971
+ */
6972
+ class DbxFirebaseExternalConnectionListViewItemComponent extends AbstractDbxValueListViewItemComponent {
6973
+ defaultIcon = DEFAULT_CONNECTION_ICON;
6974
+ autoConfirmConfig = AUTO_CONFIRM_CONFIG;
6975
+ get row() {
6976
+ return this.itemValue.row;
6977
+ }
6978
+ get assets() {
6979
+ return this.row.assets;
6980
+ }
6981
+ /**
6982
+ * Actions for this row. An ARRAY because the `error` status offers both Reconnect and Disconnect.
6983
+ *
6984
+ * @returns The actions to render, empty when there are none.
6985
+ */
6986
+ get actions() {
6987
+ return this.itemValue.actions ?? [];
6988
+ }
6989
+ get statusLabel() {
6990
+ return CONNECTION_STATUS_LABELS[this.row.status];
6991
+ }
6992
+ get statusColor() {
6993
+ return CONNECTION_STATUS_COLORS[this.row.status];
6994
+ }
6995
+ get connectedAt() {
6996
+ return this.row.status === 'connected' ? this.row.entry?.coa : undefined;
6997
+ }
6998
+ /**
6999
+ * The line under the provider name: which account is connected, or what the provider is for.
7000
+ *
7001
+ * @returns The detail line, or nullish when there is nothing to say.
7002
+ */
7003
+ get detail() {
7004
+ const { status, entry, assets } = this.row;
7005
+ let result;
7006
+ if (status === 'connected' || status === 'error') {
7007
+ result = entry?.l ?? entry?.ea ?? assets.description;
7008
+ }
7009
+ else {
7010
+ result = assets.description;
7011
+ }
7012
+ return result;
7013
+ }
7014
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionListViewItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
7015
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: DbxFirebaseExternalConnectionListViewItemComponent, isStandalone: true, selector: "dbx-firebase-external-connection-list-view-item", usesInheritance: true, ngImport: i0, template: `
7016
+ <div class="dbx-list-item-padded-thick dbx-firebase-external-connection-item">
7017
+ <div class="dbx-flex-bar dbx-pb1">
7018
+ <dbx-avatar class="dbx-icon-spacer dbx-firebase-external-connection-tile" [avatarTile]="true" avatarStyle="square" [avatarUrl]="assets.logoUrl" [avatarIcon]="assets.icon ?? defaultIcon" [avatarImageFilter]="assets.logoFilter" [avatarIgnoreDefaultUrl]="true" [avatarColor]="statusColor" [avatarColorTone]="18"></dbx-avatar>
7019
+ <div class="dbx-flex-fill">
7020
+ <div class="dbx-text-title-medium">{{ assets.providerName }}</div>
7021
+ @if (detail; as detailValue) {
7022
+ <div class="dbx-text-body-small dbx-hint">{{ detailValue }}</div>
7023
+ }
7024
+ </div>
7025
+ <dbx-chip [small]="true" [color]="statusColor">{{ statusLabel }}</dbx-chip>
7026
+ </div>
7027
+
7028
+ @if (connectedAt; as connectedAtValue) {
7029
+ <div class="dbx-text-body-small dbx-hint">Connected {{ connectedAtValue | date: 'medium' }}</div>
7030
+ }
7031
+
7032
+ @if (actions.length) {
7033
+ <div class="dbx-flex-bar dbx-pt2">
7034
+ @for (action of actions; track action.label) {
7035
+ <!-- dbxActionValue is not used: each action's handler takes no input and the confirm marks it ready, dialog or not -->
7036
+ <div dbxAction [dbxActionHandler]="action.handler" [dbxActionConfirm]="action.confirm ?? autoConfirmConfig">
7037
+ <dbx-button dbxActionButton [stroked]="true" [text]="action.label" [icon]="action.icon"></dbx-button>
7038
+ <dbx-error dbxActionError></dbx-error>
7039
+ </div>
7040
+ }
7041
+ </div>
7042
+ }
7043
+ </div>
7044
+ `, isInline: true, dependencies: [{ kind: "directive", type: DbxActionButtonDirective, selector: "[dbxActionButton]", inputs: ["dbxActionButtonEcho"] }, { kind: "directive", type: DbxActionConfirmDirective, selector: "[dbxActionConfirm]", inputs: ["dbxActionConfirm", "dbxActionConfirmSkip"] }, { kind: "directive", type: DbxActionDirective, selector: "dbx-action,[dbxAction]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: DbxActionErrorDirective, selector: "[dbxActionError]" }, { kind: "directive", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "component", type: DbxAvatarComponent, selector: "dbx-avatar", inputs: ["context", "avatarSelector", "avatarUid", "avatarUrl", "avatarName", "avatarKey", "avatarIcon", "avatarStyle", "avatarSize", "avatarHideOnError", "avatarTile", "avatarColor", "avatarColorTone", "avatarImageFit", "avatarImageFilter", "avatarIgnoreDefaultUrl"] }, { kind: "component", type: DbxButtonComponent, selector: "dbx-button", inputs: ["bar", "type", "buttonStyle", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor", "basic", "tonal", "raised", "stroked", "flat", "iconOnly", "fab", "customContent", "allowClickPropagation", "mode"] }, { kind: "directive", type: DbxChipDirective, selector: "dbx-chip", inputs: ["small", "block", "color", "display", "tone"] }, { kind: "component", type: DbxErrorComponent, selector: "dbx-error", inputs: ["error", "iconOnly"], outputs: ["popoverOpened"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
7045
+ }
7046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionListViewItemComponent, decorators: [{
7047
+ type: Component,
7048
+ args: [{
7049
+ selector: 'dbx-firebase-external-connection-list-view-item',
7050
+ template: `
7051
+ <div class="dbx-list-item-padded-thick dbx-firebase-external-connection-item">
7052
+ <div class="dbx-flex-bar dbx-pb1">
7053
+ <dbx-avatar class="dbx-icon-spacer dbx-firebase-external-connection-tile" [avatarTile]="true" avatarStyle="square" [avatarUrl]="assets.logoUrl" [avatarIcon]="assets.icon ?? defaultIcon" [avatarImageFilter]="assets.logoFilter" [avatarIgnoreDefaultUrl]="true" [avatarColor]="statusColor" [avatarColorTone]="18"></dbx-avatar>
7054
+ <div class="dbx-flex-fill">
7055
+ <div class="dbx-text-title-medium">{{ assets.providerName }}</div>
7056
+ @if (detail; as detailValue) {
7057
+ <div class="dbx-text-body-small dbx-hint">{{ detailValue }}</div>
7058
+ }
7059
+ </div>
7060
+ <dbx-chip [small]="true" [color]="statusColor">{{ statusLabel }}</dbx-chip>
7061
+ </div>
7062
+
7063
+ @if (connectedAt; as connectedAtValue) {
7064
+ <div class="dbx-text-body-small dbx-hint">Connected {{ connectedAtValue | date: 'medium' }}</div>
7065
+ }
7066
+
7067
+ @if (actions.length) {
7068
+ <div class="dbx-flex-bar dbx-pt2">
7069
+ @for (action of actions; track action.label) {
7070
+ <!-- dbxActionValue is not used: each action's handler takes no input and the confirm marks it ready, dialog or not -->
7071
+ <div dbxAction [dbxActionHandler]="action.handler" [dbxActionConfirm]="action.confirm ?? autoConfirmConfig">
7072
+ <dbx-button dbxActionButton [stroked]="true" [text]="action.label" [icon]="action.icon"></dbx-button>
7073
+ <dbx-error dbxActionError></dbx-error>
7074
+ </div>
7075
+ }
7076
+ </div>
7077
+ }
7078
+ </div>
7079
+ `,
7080
+ imports: [DatePipe, DbxActionButtonDirective, DbxActionConfirmDirective, DbxActionDirective, DbxActionErrorDirective, DbxActionHandlerDirective, DbxAvatarComponent, DbxButtonComponent, DbxChipDirective, DbxErrorComponent],
7081
+ standalone: true,
7082
+ changeDetection: ChangeDetectionStrategy.OnPush
7083
+ }]
7084
+ }] });
7085
+
7086
+ /**
7087
+ * Renders every registered third-party connection for the signed-in user.
7088
+ *
7089
+ * Owns the stores and makes exactly ONE `toSignal` subscription, which every row is computed from —
7090
+ * the payoff of collapsing to one connection document per user. The rows are presentational and take
7091
+ * their entry as a plain input rather than loading anything themselves.
7092
+ *
7093
+ * @example
7094
+ * ```html
7095
+ * <dbx-firebase-external-connections></dbx-firebase-external-connections>
7096
+ * ```
7097
+ */
7098
+ class DbxFirebaseExternalConnectionsComponent {
7099
+ dbxFirebaseAuthService = inject(DbxFirebaseAuthService);
7100
+ dbxFirebaseExternalConnectionService = inject(DbxFirebaseExternalConnectionService);
7101
+ dbxFirebaseUserExternalConnectionsStore = inject(DbxFirebaseUserExternalConnectionsStore);
7102
+ userExternalConnectionDocumentStore = inject(UserExternalConnectionDocumentStore);
7103
+ constructor() {
7104
+ // currentUid$ rather than userIdentifier$: the latter substitutes NO_AUTH_USER_IDENTIFIER ('0')
7105
+ // when signed out, which would ask Firestore for uec/0.
7106
+ this.dbxFirebaseUserExternalConnectionsStore.setUid(this.dbxFirebaseAuthService.currentUid$);
7107
+ // The connection document has to exist before a provider can be connected: the server asserts a
7108
+ // role against it, and a role map is only consulted for a document that exists. This page is where
7109
+ // it gets created — the user is present and known to want the feature, and creating it is gated
7110
+ // server-side in one place instead of being a side effect of the OAuth handoff. Nothing is created
7111
+ // for a signed-out user: no uid means no document ref, so the load never settles.
7112
+ this.dbxFirebaseUserExternalConnectionsStore.createIfMissing().pipe(takeUntilDestroyed()).subscribe();
7113
+ }
7114
+ _currentUidSignal = toSignal(this.dbxFirebaseAuthService.currentUid$, { initialValue: undefined });
7115
+ /**
7116
+ * THE shared subscription. Every row is computed from this one document read.
7117
+ */
7118
+ _entriesStateSignal = toSignal(this.dbxFirebaseUserExternalConnectionsStore.entriesLoadingState$, { initialValue: beginLoading() });
7119
+ signedInSignal = computed(() => this._currentUidSignal() != null, ...(ngDevMode ? [{ debugName: "signedInSignal" }] : /* istanbul ignore next */ []));
7120
+ errorSignal = computed(() => this._entriesStateSignal().error, ...(ngDevMode ? [{ debugName: "errorSignal" }] : /* istanbul ignore next */ []));
7121
+ rowsSignal = computed(() => {
7122
+ const state = this._entriesStateSignal();
7123
+ return dbxFirebaseExternalConnectionRows({
7124
+ providers: this.dbxFirebaseExternalConnectionService.getProviders(),
7125
+ enabledProviderTypes: this.dbxFirebaseExternalConnectionService.getEnabledTypes(),
7126
+ entries: state.value,
7127
+ loading: isLoadingStateLoading(state)
7128
+ });
7129
+ }, ...(ngDevMode ? [{ debugName: "rowsSignal" }] : /* istanbul ignore next */ []));
7130
+ /**
7131
+ * The list's state.
7132
+ *
7133
+ * Always a success result, never a loading one: a row carries its own `loading` status and renders a "Loading"
7134
+ * chip, which reads better here than the list swapping itself out for a spinner and then reflowing.
7135
+ */
7136
+ listStateSignal = computed(() => successResult(this.rowsSignal().map((row) => ({ row, actions: this.actionsForRow(row) }))), ...(ngDevMode ? [{ debugName: "listStateSignal" }] : /* istanbul ignore next */ []));
7137
+ /**
7138
+ * Builds the actions for a row.
7139
+ *
7140
+ * An errored connection offers both Reconnect and Disconnect: reconnecting is the usual fix, but a
7141
+ * user who no longer wants the integration must not be forced to reauthorize just to remove it.
7142
+ *
7143
+ * @param row - The row to build actions for.
7144
+ * @returns The actions to render, or null while loading.
7145
+ */
7146
+ actionsForRow(row) {
7147
+ const { providerType, assets, status } = row;
7148
+ const provider = this.dbxFirebaseExternalConnectionService.getProvider(providerType);
7149
+ const result = [];
7150
+ if (status !== 'loading') {
7151
+ if (status !== 'connected' && row.enabled) {
7152
+ result.push({
7153
+ label: assets.connectText ?? (status === 'error' ? 'Reconnect' : 'Connect'),
7154
+ icon: 'link',
7155
+ handler: (_, context) => context.startWorkingWithPromise(this.connectToProvider(providerType))
7156
+ });
7157
+ }
7158
+ if (status !== 'notConnected') {
7159
+ result.push({
7160
+ label: assets.disconnectText ?? 'Disconnect',
7161
+ icon: 'link_off',
7162
+ confirm: provider?.disconnectConfirm ?? {
7163
+ title: `Disconnect ${assets.providerName}?`,
7164
+ prompt: `This account will no longer be connected to ${assets.providerName}.`,
7165
+ confirmText: 'Disconnect'
7166
+ },
7167
+ handler: (_, context) => context.startWorkingWithLoadingStateObservable(this.disconnectFromProvider(providerType))
7168
+ });
7169
+ }
7170
+ }
7171
+ return result.length ? result : null;
7172
+ }
7173
+ /**
7174
+ * Starts the connect flow for a provider.
7175
+ *
7176
+ * The action stays working until the authorize page is actually opening, rather than succeeding the
7177
+ * moment the redirect is requested — the page the user is looking at has not changed yet, so a
7178
+ * success there reads as "nothing happened".
7179
+ *
7180
+ * @param providerType - The provider to connect.
7181
+ * @returns Resolves once the authorize page is actually opening.
7182
+ */
7183
+ async connectToProvider(providerType) {
7184
+ await this.dbxFirebaseExternalConnectionService.connectToProvider(providerType);
7185
+ }
7186
+ /**
7187
+ * Disconnects the signed-in user from a provider.
7188
+ *
7189
+ * @param providerType - The provider to disconnect.
7190
+ * @returns The loading state observable of the callable.
7191
+ */
7192
+ disconnectFromProvider(providerType) {
7193
+ return this.userExternalConnectionDocumentStore.disconnectUserExternalConnection({ providerType });
7194
+ }
7195
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
7196
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: DbxFirebaseExternalConnectionsComponent, isStandalone: true, selector: "dbx-firebase-external-connections", host: { classAttribute: "d-block dbx-firebase-external-connections" }, providers: [UserExternalConnectionDocumentStore, DbxFirebaseUserExternalConnectionsStore], ngImport: i0, template: `
7197
+ @if (signedInSignal()) {
7198
+ @if (errorSignal(); as error) {
7199
+ <dbx-error [error]="error"></dbx-error>
7200
+ } @else {
7201
+ <dbx-firebase-external-connection-list [state]="listStateSignal()">
7202
+ <dbx-list-empty-content empty>
7203
+ <p class="dbx-hint no-margin">There are no apps available to connect.</p>
7204
+ </dbx-list-empty-content>
7205
+ </dbx-firebase-external-connection-list>
7206
+ }
7207
+ } @else {
7208
+ <p class="dbx-hint no-margin">Sign in to connect your apps.</p>
7209
+ }
7210
+ `, isInline: true, dependencies: [{ kind: "component", type: DbxErrorComponent, selector: "dbx-error", inputs: ["error", "iconOnly"], outputs: ["popoverOpened"] }, { kind: "component", type: DbxFirebaseExternalConnectionListComponent, selector: "dbx-firebase-external-connection-list" }, { kind: "component", type: DbxListEmptyContentComponent, selector: "dbx-list-empty-content" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
7211
+ }
7212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseExternalConnectionsComponent, decorators: [{
7213
+ type: Component,
7214
+ args: [{
7215
+ selector: 'dbx-firebase-external-connections',
7216
+ template: `
7217
+ @if (signedInSignal()) {
7218
+ @if (errorSignal(); as error) {
7219
+ <dbx-error [error]="error"></dbx-error>
7220
+ } @else {
7221
+ <dbx-firebase-external-connection-list [state]="listStateSignal()">
7222
+ <dbx-list-empty-content empty>
7223
+ <p class="dbx-hint no-margin">There are no apps available to connect.</p>
7224
+ </dbx-list-empty-content>
7225
+ </dbx-firebase-external-connection-list>
7226
+ }
7227
+ } @else {
7228
+ <p class="dbx-hint no-margin">Sign in to connect your apps.</p>
7229
+ }
7230
+ `,
7231
+ host: {
7232
+ class: 'd-block dbx-firebase-external-connections'
7233
+ },
7234
+ standalone: true,
7235
+ imports: [DbxErrorComponent, DbxFirebaseExternalConnectionListComponent, DbxListEmptyContentComponent],
7236
+ providers: [UserExternalConnectionDocumentStore, DbxFirebaseUserExternalConnectionsStore],
7237
+ changeDetection: ChangeDetectionStrategy.OnPush
7238
+ }]
7239
+ }], ctorParameters: () => [] });
7240
+
7241
+ /**
7242
+ * Registers the third-party connection providers an app offers, plus the registry service and the
7243
+ * collection token the connection stores read from.
7244
+ *
7245
+ * A SIBLING of `provideDbxFirebase()` (like `provideDbxFirebaseLogin()` / `provideDbxFirebaseOidc()`)
7246
+ * rather than part of it: it requires an app-supplied provider catalog and depends on
7247
+ * `provideDbxFirestoreCollection()` having run.
7248
+ *
7249
+ * Naming a known provider type is all an app needs to offer that service: the library carries the
7250
+ * presentation, and the connect flow — minting the signed `state`, then redirecting to the authorize
7251
+ * url carrying it — is the library's default. Nothing about it belongs in an app's config.
7252
+ *
7253
+ * @param config - The provider catalog and authorize configuration.
7254
+ * @returns EnvironmentProviders.
7255
+ *
7256
+ * @example
7257
+ * ```ts
7258
+ * provideDbxFirebaseExternalConnections({
7259
+ * appCollectionClass: DemoFirestoreCollections,
7260
+ * authorizeOrigin: environment.externalConnectionAuthorizeOrigin,
7261
+ * providers: [
7262
+ * CALCOM_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE,
7263
+ * // start from a known provider and reword one line
7264
+ * dbxFirebaseKnownExternalConnectionProvider({ providerType: DISCORD_USER_EXTERNAL_CONNECTION_PROVIDER_TYPE, assets: { description: 'Link Discord to get notified in your server.' } }),
7265
+ * // or declare a service the library has no defaults for
7266
+ * APP_INTERNAL_EXTERNAL_CONNECTION_PROVIDER
7267
+ * ]
7268
+ * })
7269
+ * ```
7270
+ */
7271
+ function provideDbxFirebaseExternalConnections(config) {
7272
+ const { appCollectionClass } = config;
7273
+ const providers = [
7274
+ {
7275
+ provide: DbxFirebaseExternalConnectionsConfig,
7276
+ useValue: config
7277
+ },
7278
+ {
7279
+ provide: DbxFirebaseUserExternalConnectionCollections,
7280
+ useExisting: appCollectionClass
7281
+ },
7282
+ {
7283
+ provide: DbxFirebaseExternalConnectionService,
7284
+ useClass: DbxFirebaseExternalConnectionService
7285
+ }
7286
+ ];
7287
+ return makeEnvironmentProviders(providers);
7288
+ }
7289
+
6265
7290
  /**
6266
7291
  * App-level tuning for the notification delivery health check UI.
6267
7292
  *
@@ -6605,7 +7630,7 @@ class DbxFirebaseNotificationHealthCheckIssueComponent {
6605
7630
  <p class="dbx-hint no-margin dbx-pt1">{{ issueValue.f }}</p>
6606
7631
  }
6607
7632
  }
6608
- `, isInline: true, dependencies: [{ kind: "directive", type: DbxChipDirective, selector: "dbx-chip", inputs: ["small", "block", "color", "display", "tone"] }, { kind: "directive", type: DbxColorDirective, selector: "[dbxColor]", inputs: ["dbxColor", "dbxColorTone"], outputs: ["dbxColorChange"] }, { kind: "component", type: DbxIconTileComponent, selector: "dbx-icon-tile", inputs: ["icon", "round"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
7633
+ `, isInline: true, dependencies: [{ kind: "directive", type: DbxChipDirective, selector: "dbx-chip", inputs: ["small", "block", "color", "display", "tone"] }, { kind: "directive", type: DbxColorDirective, selector: "[dbxColor]", inputs: ["dbxColor", "dbxColorTone"], outputs: ["dbxColorChange", "dbxColorToneChange"] }, { kind: "component", type: DbxIconTileComponent, selector: "dbx-icon-tile", inputs: ["icon", "round"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6609
7634
  }
6610
7635
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseNotificationHealthCheckIssueComponent, decorators: [{
6611
7636
  type: Component,
@@ -6730,7 +7755,7 @@ class DbxFirebaseNotificationHealthCheckMethodComponent {
6730
7755
  }
6731
7756
  }
6732
7757
  }
6733
- `, isInline: true, dependencies: [{ kind: "directive", type: DbxActionButtonDirective, selector: "[dbxActionButton]", inputs: ["dbxActionButtonEcho"] }, { kind: "directive", type: DbxActionConfirmDirective, selector: "[dbxActionConfirm]", inputs: ["dbxActionConfirm", "dbxActionConfirmSkip"] }, { kind: "directive", type: DbxActionDirective, selector: "dbx-action,[dbxAction]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: DbxActionDisabledDirective, selector: "[dbxActionDisabled]", inputs: ["dbxActionDisabled"] }, { kind: "directive", type: DbxActionErrorDirective, selector: "[dbxActionError]" }, { kind: "directive", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "component", type: DbxButtonComponent, selector: "dbx-button", inputs: ["bar", "type", "buttonStyle", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor", "basic", "tonal", "raised", "stroked", "flat", "iconOnly", "fab", "customContent", "allowClickPropagation", "mode"] }, { kind: "directive", type: DbxChipDirective, selector: "dbx-chip", inputs: ["small", "block", "color", "display", "tone"] }, { kind: "directive", type: DbxColorDirective, selector: "[dbxColor]", inputs: ["dbxColor", "dbxColorTone"], outputs: ["dbxColorChange"] }, { kind: "component", type: DbxErrorComponent, selector: "dbx-error", inputs: ["error", "iconOnly"], outputs: ["popoverOpened"] }, { kind: "component", type: DbxIconTileComponent, selector: "dbx-icon-tile", inputs: ["icon", "round"] }, { kind: "component", type: DbxFirebaseNotificationHealthCheckIssueComponent, selector: "dbx-firebase-notification-healthcheck-issue", inputs: ["issue", "method"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
7758
+ `, isInline: true, dependencies: [{ kind: "directive", type: DbxActionButtonDirective, selector: "[dbxActionButton]", inputs: ["dbxActionButtonEcho"] }, { kind: "directive", type: DbxActionConfirmDirective, selector: "[dbxActionConfirm]", inputs: ["dbxActionConfirm", "dbxActionConfirmSkip"] }, { kind: "directive", type: DbxActionDirective, selector: "dbx-action,[dbxAction]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: DbxActionDisabledDirective, selector: "[dbxActionDisabled]", inputs: ["dbxActionDisabled"] }, { kind: "directive", type: DbxActionErrorDirective, selector: "[dbxActionError]" }, { kind: "directive", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "component", type: DbxButtonComponent, selector: "dbx-button", inputs: ["bar", "type", "buttonStyle", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor", "basic", "tonal", "raised", "stroked", "flat", "iconOnly", "fab", "customContent", "allowClickPropagation", "mode"] }, { kind: "directive", type: DbxChipDirective, selector: "dbx-chip", inputs: ["small", "block", "color", "display", "tone"] }, { kind: "directive", type: DbxColorDirective, selector: "[dbxColor]", inputs: ["dbxColor", "dbxColorTone"], outputs: ["dbxColorChange", "dbxColorToneChange"] }, { kind: "component", type: DbxErrorComponent, selector: "dbx-error", inputs: ["error", "iconOnly"], outputs: ["popoverOpened"] }, { kind: "component", type: DbxIconTileComponent, selector: "dbx-icon-tile", inputs: ["icon", "round"] }, { kind: "component", type: DbxFirebaseNotificationHealthCheckIssueComponent, selector: "dbx-firebase-notification-healthcheck-issue", inputs: ["issue", "method"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6734
7759
  }
6735
7760
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseNotificationHealthCheckMethodComponent, decorators: [{
6736
7761
  type: Component,
@@ -6871,7 +7896,7 @@ class DbxFirebaseNotificationHealthCheckComponent {
6871
7896
  </dbx-content-pit>
6872
7897
  }
6873
7898
  }
6874
- `, isInline: true, dependencies: [{ kind: "directive", type: DbxColorDirective, selector: "[dbxColor]", inputs: ["dbxColor", "dbxColorTone"], outputs: ["dbxColorChange"] }, { kind: "directive", type: DbxContentPitDirective, selector: "dbx-content-pit, [dbxContentPit]", inputs: ["scrollable", "square"] }, { kind: "component", type: DbxIconTileComponent, selector: "dbx-icon-tile", inputs: ["icon", "round"] }, { kind: "component", type: DbxFirebaseNotificationHealthCheckMethodComponent, selector: "dbx-firebase-notification-healthcheck-method", inputs: ["result", "probeAction"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
7899
+ `, isInline: true, dependencies: [{ kind: "directive", type: DbxColorDirective, selector: "[dbxColor]", inputs: ["dbxColor", "dbxColorTone"], outputs: ["dbxColorChange", "dbxColorToneChange"] }, { kind: "directive", type: DbxContentPitDirective, selector: "dbx-content-pit, [dbxContentPit]", inputs: ["scrollable", "square"] }, { kind: "component", type: DbxIconTileComponent, selector: "dbx-icon-tile", inputs: ["icon", "round"] }, { kind: "component", type: DbxFirebaseNotificationHealthCheckMethodComponent, selector: "dbx-firebase-notification-healthcheck-method", inputs: ["result", "probeAction"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6875
7900
  }
6876
7901
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseNotificationHealthCheckComponent, decorators: [{
6877
7902
  type: Component,
@@ -9735,5 +10760,5 @@ function provideDbxFirebase(config) {
9735
10760
  * Generated bundle index. Do not edit.
9736
10761
  */
9737
10762
 
9738
- export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, AbstractDbxFirebaseModelEntityWidgetDirective, AbstractDbxFirebaseNotificationItemWidgetComponent, AbstractRootSingleItemDbxFirebaseDocument, AbstractSingleItemDbxFirebaseDocument, AbstractSystemStateDocumentStoreAccessor, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION, DBX_FIREBASE_APP_OPTIONS_TOKEN, DBX_FIREBASE_AUTH_FLOW_TOKEN, DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN, DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_TOKEN, DBX_FIREBASE_STORAGE_PDF_MERGE_UPLOAD_FILE_NAME, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY, DEFAULT_DBX_FIREBASE_AUTH_FLOW, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE, DEFAULT_DBX_FIREBASE_ID_ROUTER_PARAM_ID_PARAM_KEY, DEFAULT_DBX_FIREBASE_ID_ROUTER_PARAM_KEY_PARAM_KEY, DEFAULT_DBX_FIREBASE_ID_ROUTER_PARAM_USE_PARAM_VALUE, DEFAULT_DBX_FIREBASE_MODEL_ENTITIES_COMPONENT_POPOVER_KEY, DEFAULT_DBX_FIREBASE_MODEL_HISTORY_COMPONENT_POPOVER_KEY, DEFAULT_DBX_FIREBASE_NOTIFICATION_ITEM_STORE_POPOVER_KEY, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION, DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN, DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY, DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN, DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE, DEFAULT_NOTIFICATION_HEALTH_CHECK_PRESENTATION_ENTRIES, DEFAULT_NOTIFICATION_HEALTH_CHECK_PROBE_WATCH_MINUTES, DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY, DbxFirebaseAnalyticsUserEventsListenerService, DbxFirebaseAnalyticsUserSource, DbxFirebaseAppCheckHttpInterceptor, DbxFirebaseAuthImpersonationDelegate, DbxFirebaseAuthLoginService, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionChangeTriggerInstance, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseCollectionWithParentStoreDirective, DbxFirebaseDevelopmentDirective, DbxFirebaseDevelopmentModule, DbxFirebaseDevelopmentPopupComponent, DbxFirebaseDevelopmentPopupContentComponent, DbxFirebaseDevelopmentPopupContentForgeFormComponent, DbxFirebaseDevelopmentSchedulerListComponent, DbxFirebaseDevelopmentSchedulerListViewComponent, DbxFirebaseDevelopmentSchedulerListViewItemComponent, DbxFirebaseDevelopmentSchedulerService, DbxFirebaseDevelopmentSchedulerWidgetComponent, DbxFirebaseDevelopmentService, DbxFirebaseDevelopmentWidgetService, DbxFirebaseDocumentLoaderInstance, DbxFirebaseDocumentStoreContextModelEntitiesSourceDirective, DbxFirebaseDocumentStoreContextStore, DbxFirebaseDocumentStoreContextStoreDirective, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective, DbxFirebaseDocumentStoreTwoWayKeyProvider, DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective, DbxFirebaseEmailForgeFormComponent, DbxFirebaseEmailRecoveryForgeFormComponent, DbxFirebaseEmulatorService, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseManageAuthProvidersComponent, DbxFirebaseModelContextService, DbxFirebaseModelEntitiesComponent, DbxFirebaseModelEntitiesDebugWidgetComponent, DbxFirebaseModelEntitiesPopoverButtonComponent, DbxFirebaseModelEntitiesPopoverComponent, DbxFirebaseModelEntitiesSource, DbxFirebaseModelEntitiesWidgetService, DbxFirebaseModelEntitiesWidgetServiceConfig, DbxFirebaseModelHistoryComponent, DbxFirebaseModelHistoryPopoverButtonComponent, DbxFirebaseModelHistoryPopoverComponent, DbxFirebaseModelKeyComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModelTrackerService, DbxFirebaseModelTypeInstanceListComponent, DbxFirebaseModelTypeInstanceListViewComponent, DbxFirebaseModelTypeInstanceListViewItemComponent, DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceConfig, DbxFirebaseModelViewedEventDirective, DbxFirebaseModule, DbxFirebaseNotificationBoxCollectionStoreDirective, DbxFirebaseNotificationBoxDocumentStoreDirective, DbxFirebaseNotificationCollectionStoreDirective, DbxFirebaseNotificationDocumentStoreDirective, DbxFirebaseNotificationHealthCheckComponent, DbxFirebaseNotificationHealthCheckConfig, DbxFirebaseNotificationHealthCheckDialogButtonComponent, DbxFirebaseNotificationHealthCheckDialogComponent, DbxFirebaseNotificationHealthCheckIssueComponent, DbxFirebaseNotificationHealthCheckMethodComponent, DbxFirebaseNotificationHealthCheckPresentationService, DbxFirebaseNotificationHealthCheckPresentationServiceConfig, DbxFirebaseNotificationHealthCheckViewComponent, DbxFirebaseNotificationItemContentComponent, DbxFirebaseNotificationItemDefaultViewComponent, DbxFirebaseNotificationItemListComponent, DbxFirebaseNotificationItemListViewComponent, DbxFirebaseNotificationItemListViewItemComponent, DbxFirebaseNotificationItemStore, DbxFirebaseNotificationItemStorePopoverButtonComponent, DbxFirebaseNotificationItemStorePopoverComponent, DbxFirebaseNotificationItemViewComponent, DbxFirebaseNotificationItemWidgetService, DbxFirebaseNotificationSummaryCollectionStoreDirective, DbxFirebaseNotificationSummaryDocumentStoreDirective, DbxFirebaseNotificationTemplateService, DbxFirebaseNotificationUserCollectionStoreDirective, DbxFirebaseNotificationUserDocumentStoreDirective, DbxFirebaseNotificationUserHealthCheckStore, DbxFirebaseParsedEmulatorsConfig, DbxFirebasePasswordResetComponent, DbxFirebasePasswordResetFormComponent, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirebaseStorageFileCollectionStoreDirective, DbxFirebaseStorageFileDocumentStoreDirective, DbxFirebaseStorageFileDownloadButtonComponent, DbxFirebaseStorageFileDownloadService, DbxFirebaseStorageFileDownloadStorage, DbxFirebaseStorageFileGroupDocumentStoreDirective, DbxFirebaseStorageFileUploadActionHandlerDirective, DbxFirebaseStorageFileUploadInitializeDocumentDirective, DbxFirebaseStorageFileUploadModule, DbxFirebaseStorageFileUploadStore, DbxFirebaseStorageFileUploadStoreDirective, DbxFirebaseStorageFileUploadSyncDirective, DbxFirebaseStoragePdfMergeUploadSyncDirective, DbxFirebaseStorageService, DbxFirebaseSystemStateCollectionStoreDirective, DbxFirebaseSystemStateDocumentStoreDirective, DbxFirestoreContextService, DbxLimitedFirebaseDocumentLoaderInstance, FIREBASE_APP_CHECK_TOKEN, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_FUNCTIONS_TOKEN, FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE_PREFIX, FIREBASE_PROVIDER_ID_TO_LOGIN_METHOD_TYPE_MAP, FIREBASE_STORAGE_TOKEN, FlatFirestoreModelKeyPipe, IMPORTS_AND_EXPORTS, LOGIN_METHOD_TYPE_TO_FIREBASE_PROVIDER_ID_MAP, NOTIFICATION_DELIVERY_METHOD_ICONS, NOTIFICATION_DELIVERY_METHOD_LABELS, NOTIFICATION_DELIVERY_METHOD_SHORT_LABELS, NOTIFICATION_DELIVERY_METHOD_TEST_MESSAGE_LABELS, NOTIFICATION_DELIVERY_METHOD_TEST_MESSAGE_NOUNS, NOTIFICATION_HEALTH_CHECK_PROBE_ISSUE_OUTCOMES, NOTIFICATION_HEALTH_CHECK_STATUS_COLORS, NOTIFICATION_HEALTH_CHECK_STATUS_ICONS, NOTIFICATION_HEALTH_CHECK_STATUS_LABELS, NotificationBoxCollectionStore, NotificationBoxDocumentStore, NotificationCollectionStore, NotificationDocumentStore, NotificationSummaryCollectionStore, NotificationSummaryDocumentStore, NotificationUserCollectionStore, NotificationUserDocumentStore, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, StorageFileCollectionStore, StorageFileDocumentStore, StorageFileGroupDocumentStore, StorageFileUploadFilesError, SystemStateCollectionStore, SystemStateDocumentStore, TwoWayFlatFirestoreModelKeyPipe, authRolesObsWithClaimsService, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthServiceFunction, createDbxFirebaseAppCheck, createDbxFirebaseAuth, createDbxFirebaseFirestore, createDbxFirebaseFunctions, createDbxFirebaseStorage, dbxFirebaseAuthContextInfo, dbxFirebaseCollectionChangeTrigger, dbxFirebaseCollectionChangeTriggerForStore, dbxFirebaseCollectionChangeTriggerForWatcher, dbxFirebaseCollectionChangeWatcher, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, dbxFirebaseDocumentLoaderInstance, dbxFirebaseDocumentLoaderInstanceWithAccessor, dbxFirebaseDocumentStoreContextModelEntitiesSourceFactory, dbxFirebaseIdRouteParamRedirect, dbxFirebaseInContextFirebaseModelServiceInstance, dbxFirebaseInContextFirebaseModelServiceInstanceFactory, dbxFirebaseKeyRouteParamRedirect, dbxFirebaseModelContextServiceInfoInstanceFactory, dbxFirebaseModelEntityWidgetInjectionConfigFactory, dbxFirebaseModelTypesServiceInstance, dbxFirebaseModelTypesServiceInstancePairForKeysFactory, dbxFirebaseSourceSelectLoadSource, dbxFirebaseStorageFileDownloadServiceCustomSourceFromObs, dbxFirebaseStorageFileImageCompressionFileModifier, dbxFirebaseStorageProvidersContextConfigFactory, dbxLimitedFirebaseDocumentLoaderInstance, dbxLimitedFirebaseDocumentLoaderInstanceWithAccessor, dbxWidgetTypeForNotificationTemplateType, defaultDbxFirebaseAuthServiceDelegateWithClaimsService, defaultDbxFirebaseStorageFileDownloadStorageAccessorFactory, developmentFirebaseServerSchedulerWidgetEntry, enableAppCheckDebugTokenGeneration, firebaseAuthState, firebaseAuthTokenFromUser, firebaseCollectionStoreCreateFunction, firebaseCollectionStoreCrudFunction, firebaseContextServiceEntityMap, firebaseDocumentStoreCreateFunction, firebaseDocumentStoreCrudFunction, firebaseDocumentStoreDeleteFunction, firebaseDocumentStoreInvokeFunction, firebaseDocumentStoreReadFunction, firebaseDocumentStoreUpdateFunction, firebaseIdToken, firebaseProviderIdToLoginMethodType, isDbxFirebaseModelEntityWithStore, isStandaloneWebApp, linkDocumentStoreToParentContextStores, loginMethodTypeToFirebaseProviderId, modelDoesNotExistError, notificationHealthCheckProbeIssueLabel, parseDbxFirebaseEmulatorsConfig, provideDbxFirebase, provideDbxFirebaseAnalyticsUserEventsListenerService, provideDbxFirebaseApp, provideDbxFirebaseAuth, provideDbxFirebaseAuthImpersonation, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionWithParentStoreDirective, provideDbxFirebaseDevelopment, provideDbxFirebaseDocumentStoreContextStore, provideDbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreTwoWayKeyProvider, provideDbxFirebaseFunctions, provideDbxFirebaseLogin, provideDbxFirebaseModelContextService, provideDbxFirebaseModelEntitiesWidgetService, provideDbxFirebaseNotifications, provideDbxFirebaseStorageFileService, provideDbxFirestoreCollection, provideNotificationFirestoreCollections, provideStorageFileFirestoreCollections, provideSystemStateFirestoreCollections, providedDbxFirebaseStorage, readDbxAnalyticsUserPropertiesFromAuthUserInfo, readValueFromIdToken, resolveDbxFirebaseAuthFlow, setParentStoreEffect, stateFromTokenForLoggedInUserFunction, storageFileUploadFiles, storageFileUploadHandler };
10763
+ export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, AbstractDbxFirebaseModelEntityWidgetDirective, AbstractDbxFirebaseNotificationItemWidgetComponent, AbstractRootSingleItemDbxFirebaseDocument, AbstractSingleItemDbxFirebaseDocument, AbstractSystemStateDocumentStoreAccessor, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION, DBX_FIREBASE_APP_OPTIONS_TOKEN, DBX_FIREBASE_AUTH_FLOW_TOKEN, DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN, DBX_FIREBASE_EXTERNAL_CONNECTION_CALCOM_PROVIDER, DBX_FIREBASE_EXTERNAL_CONNECTION_DISCORD_PROVIDER, DBX_FIREBASE_EXTERNAL_CONNECTION_ZOHO_PROVIDER, DBX_FIREBASE_EXTERNAL_CONNECTION_ZOOM_PROVIDER, DBX_FIREBASE_KNOWN_EXTERNAL_CONNECTION_PROVIDERS, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN, DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_TOKEN, DBX_FIREBASE_STORAGE_PDF_MERGE_UPLOAD_FILE_NAME, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY, DEFAULT_DBX_FIREBASE_AUTH_FLOW, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE, DEFAULT_DBX_FIREBASE_ID_ROUTER_PARAM_ID_PARAM_KEY, DEFAULT_DBX_FIREBASE_ID_ROUTER_PARAM_KEY_PARAM_KEY, DEFAULT_DBX_FIREBASE_ID_ROUTER_PARAM_USE_PARAM_VALUE, DEFAULT_DBX_FIREBASE_MODEL_ENTITIES_COMPONENT_POPOVER_KEY, DEFAULT_DBX_FIREBASE_MODEL_HISTORY_COMPONENT_POPOVER_KEY, DEFAULT_DBX_FIREBASE_NOTIFICATION_ITEM_STORE_POPOVER_KEY, DEFAULT_EXTERNAL_CONNECTION_AUTHORIZE_PATH_FACTORY, DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_FUNCTION, DEFAULT_EXTERNAL_CONNECTION_NAVIGATE_TIMEOUT, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION, DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN, DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY, DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN, DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE, DEFAULT_NOTIFICATION_HEALTH_CHECK_PRESENTATION_ENTRIES, DEFAULT_NOTIFICATION_HEALTH_CHECK_PROBE_WATCH_MINUTES, DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY, DbxFirebaseAnalyticsUserEventsListenerService, DbxFirebaseAnalyticsUserSource, DbxFirebaseAppCheckHttpInterceptor, DbxFirebaseAuthImpersonationDelegate, DbxFirebaseAuthLoginService, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionChangeTriggerInstance, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseCollectionWithParentStoreDirective, DbxFirebaseDevelopmentDirective, DbxFirebaseDevelopmentModule, DbxFirebaseDevelopmentPopupComponent, DbxFirebaseDevelopmentPopupContentComponent, DbxFirebaseDevelopmentPopupContentForgeFormComponent, DbxFirebaseDevelopmentSchedulerListComponent, DbxFirebaseDevelopmentSchedulerListViewComponent, DbxFirebaseDevelopmentSchedulerListViewItemComponent, DbxFirebaseDevelopmentSchedulerService, DbxFirebaseDevelopmentSchedulerWidgetComponent, DbxFirebaseDevelopmentService, DbxFirebaseDevelopmentWidgetService, DbxFirebaseDocumentLoaderInstance, DbxFirebaseDocumentStoreContextModelEntitiesSourceDirective, DbxFirebaseDocumentStoreContextStore, DbxFirebaseDocumentStoreContextStoreDirective, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective, DbxFirebaseDocumentStoreTwoWayKeyProvider, DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective, DbxFirebaseEmailForgeFormComponent, DbxFirebaseEmailRecoveryForgeFormComponent, DbxFirebaseEmulatorService, DbxFirebaseExternalConnectionListComponent, DbxFirebaseExternalConnectionListViewComponent, DbxFirebaseExternalConnectionListViewItemComponent, DbxFirebaseExternalConnectionService, DbxFirebaseExternalConnectionsComponent, DbxFirebaseExternalConnectionsConfig, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseManageAuthProvidersComponent, DbxFirebaseModelContextService, DbxFirebaseModelEntitiesComponent, DbxFirebaseModelEntitiesDebugWidgetComponent, DbxFirebaseModelEntitiesPopoverButtonComponent, DbxFirebaseModelEntitiesPopoverComponent, DbxFirebaseModelEntitiesSource, DbxFirebaseModelEntitiesWidgetService, DbxFirebaseModelEntitiesWidgetServiceConfig, DbxFirebaseModelHistoryComponent, DbxFirebaseModelHistoryPopoverButtonComponent, DbxFirebaseModelHistoryPopoverComponent, DbxFirebaseModelKeyComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModelTrackerService, DbxFirebaseModelTypeInstanceListComponent, DbxFirebaseModelTypeInstanceListViewComponent, DbxFirebaseModelTypeInstanceListViewItemComponent, DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceConfig, DbxFirebaseModelViewedEventDirective, DbxFirebaseModule, DbxFirebaseNotificationBoxCollectionStoreDirective, DbxFirebaseNotificationBoxDocumentStoreDirective, DbxFirebaseNotificationCollectionStoreDirective, DbxFirebaseNotificationDocumentStoreDirective, DbxFirebaseNotificationHealthCheckComponent, DbxFirebaseNotificationHealthCheckConfig, DbxFirebaseNotificationHealthCheckDialogButtonComponent, DbxFirebaseNotificationHealthCheckDialogComponent, DbxFirebaseNotificationHealthCheckIssueComponent, DbxFirebaseNotificationHealthCheckMethodComponent, DbxFirebaseNotificationHealthCheckPresentationService, DbxFirebaseNotificationHealthCheckPresentationServiceConfig, DbxFirebaseNotificationHealthCheckViewComponent, DbxFirebaseNotificationItemContentComponent, DbxFirebaseNotificationItemDefaultViewComponent, DbxFirebaseNotificationItemListComponent, DbxFirebaseNotificationItemListViewComponent, DbxFirebaseNotificationItemListViewItemComponent, DbxFirebaseNotificationItemStore, DbxFirebaseNotificationItemStorePopoverButtonComponent, DbxFirebaseNotificationItemStorePopoverComponent, DbxFirebaseNotificationItemViewComponent, DbxFirebaseNotificationItemWidgetService, DbxFirebaseNotificationSummaryCollectionStoreDirective, DbxFirebaseNotificationSummaryDocumentStoreDirective, DbxFirebaseNotificationTemplateService, DbxFirebaseNotificationUserCollectionStoreDirective, DbxFirebaseNotificationUserDocumentStoreDirective, DbxFirebaseNotificationUserHealthCheckStore, DbxFirebaseParsedEmulatorsConfig, DbxFirebasePasswordResetComponent, DbxFirebasePasswordResetFormComponent, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirebaseStorageFileCollectionStoreDirective, DbxFirebaseStorageFileDocumentStoreDirective, DbxFirebaseStorageFileDownloadButtonComponent, DbxFirebaseStorageFileDownloadService, DbxFirebaseStorageFileDownloadStorage, DbxFirebaseStorageFileGroupDocumentStoreDirective, DbxFirebaseStorageFileUploadActionHandlerDirective, DbxFirebaseStorageFileUploadInitializeDocumentDirective, DbxFirebaseStorageFileUploadModule, DbxFirebaseStorageFileUploadStore, DbxFirebaseStorageFileUploadStoreDirective, DbxFirebaseStorageFileUploadSyncDirective, DbxFirebaseStoragePdfMergeUploadSyncDirective, DbxFirebaseStorageService, DbxFirebaseSystemStateCollectionStoreDirective, DbxFirebaseSystemStateDocumentStoreDirective, DbxFirebaseUserExternalConnectionCollections, DbxFirebaseUserExternalConnectionDocumentStoreDirective, DbxFirebaseUserExternalConnectionsStore, DbxFirestoreContextService, DbxLimitedFirebaseDocumentLoaderInstance, FIREBASE_APP_CHECK_TOKEN, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_FUNCTIONS_TOKEN, FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE_PREFIX, FIREBASE_PROVIDER_ID_TO_LOGIN_METHOD_TYPE_MAP, FIREBASE_STORAGE_TOKEN, FlatFirestoreModelKeyPipe, IMPORTS_AND_EXPORTS, LOGIN_METHOD_TYPE_TO_FIREBASE_PROVIDER_ID_MAP, NOTIFICATION_DELIVERY_METHOD_ICONS, NOTIFICATION_DELIVERY_METHOD_LABELS, NOTIFICATION_DELIVERY_METHOD_SHORT_LABELS, NOTIFICATION_DELIVERY_METHOD_TEST_MESSAGE_LABELS, NOTIFICATION_DELIVERY_METHOD_TEST_MESSAGE_NOUNS, NOTIFICATION_HEALTH_CHECK_PROBE_ISSUE_OUTCOMES, NOTIFICATION_HEALTH_CHECK_STATUS_COLORS, NOTIFICATION_HEALTH_CHECK_STATUS_ICONS, NOTIFICATION_HEALTH_CHECK_STATUS_LABELS, NotificationBoxCollectionStore, NotificationBoxDocumentStore, NotificationCollectionStore, NotificationDocumentStore, NotificationSummaryCollectionStore, NotificationSummaryDocumentStore, NotificationUserCollectionStore, NotificationUserDocumentStore, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, StorageFileCollectionStore, StorageFileDocumentStore, StorageFileGroupDocumentStore, StorageFileUploadFilesError, SystemStateCollectionStore, SystemStateDocumentStore, TwoWayFlatFirestoreModelKeyPipe, UserExternalConnectionDocumentStore, authRolesObsWithClaimsService, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthServiceFunction, createDbxFirebaseAppCheck, createDbxFirebaseAuth, createDbxFirebaseFirestore, createDbxFirebaseFunctions, createDbxFirebaseStorage, dbxFirebaseAuthContextInfo, dbxFirebaseCollectionChangeTrigger, dbxFirebaseCollectionChangeTriggerForStore, dbxFirebaseCollectionChangeTriggerForWatcher, dbxFirebaseCollectionChangeWatcher, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, dbxFirebaseDocumentLoaderInstance, dbxFirebaseDocumentLoaderInstanceWithAccessor, dbxFirebaseDocumentStoreContextModelEntitiesSourceFactory, dbxFirebaseExternalConnectionProviderForEntry, dbxFirebaseExternalConnectionRowStatusForEntry, dbxFirebaseExternalConnectionRows, dbxFirebaseIdRouteParamRedirect, dbxFirebaseInContextFirebaseModelServiceInstance, dbxFirebaseInContextFirebaseModelServiceInstanceFactory, dbxFirebaseKeyRouteParamRedirect, dbxFirebaseKnownExternalConnectionProvider, dbxFirebaseModelContextServiceInfoInstanceFactory, dbxFirebaseModelEntityWidgetInjectionConfigFactory, dbxFirebaseModelTypesServiceInstance, dbxFirebaseModelTypesServiceInstancePairForKeysFactory, dbxFirebaseSourceSelectLoadSource, dbxFirebaseStorageFileDownloadServiceCustomSourceFromObs, dbxFirebaseStorageFileImageCompressionFileModifier, dbxFirebaseStorageProvidersContextConfigFactory, dbxLimitedFirebaseDocumentLoaderInstance, dbxLimitedFirebaseDocumentLoaderInstanceWithAccessor, dbxWidgetTypeForNotificationTemplateType, defaultDbxFirebaseAuthServiceDelegateWithClaimsService, defaultDbxFirebaseStorageFileDownloadStorageAccessorFactory, developmentFirebaseServerSchedulerWidgetEntry, enableAppCheckDebugTokenGeneration, externalConnectionsLoadingStateFromDocumentLoadingState, firebaseAuthState, firebaseAuthTokenFromUser, firebaseCollectionStoreCreateFunction, firebaseCollectionStoreCrudFunction, firebaseContextServiceEntityMap, firebaseDocumentStoreCreateFunction, firebaseDocumentStoreCrudFunction, firebaseDocumentStoreDeleteFunction, firebaseDocumentStoreInvokeFunction, firebaseDocumentStoreReadFunction, firebaseDocumentStoreUpdateFunction, firebaseIdToken, firebaseProviderIdToLoginMethodType, isDbxFirebaseModelEntityWithStore, isStandaloneWebApp, linkDocumentStoreToParentContextStores, loginMethodTypeToFirebaseProviderId, modelDoesNotExistError, navigateAndWaitForPageToLeave, notificationHealthCheckProbeIssueLabel, parseDbxFirebaseEmulatorsConfig, provideDbxFirebase, provideDbxFirebaseAnalyticsUserEventsListenerService, provideDbxFirebaseApp, provideDbxFirebaseAuth, provideDbxFirebaseAuthImpersonation, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionWithParentStoreDirective, provideDbxFirebaseDevelopment, provideDbxFirebaseDocumentStoreContextStore, provideDbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreTwoWayKeyProvider, provideDbxFirebaseExternalConnections, provideDbxFirebaseFunctions, provideDbxFirebaseLogin, provideDbxFirebaseModelContextService, provideDbxFirebaseModelEntitiesWidgetService, provideDbxFirebaseNotifications, provideDbxFirebaseStorageFileService, provideDbxFirestoreCollection, provideNotificationFirestoreCollections, provideStorageFileFirestoreCollections, provideSystemStateFirestoreCollections, providedDbxFirebaseStorage, readDbxAnalyticsUserPropertiesFromAuthUserInfo, readValueFromIdToken, resolveDbxFirebaseAuthFlow, setParentStoreEffect, shouldCreateUserExternalConnectionForDocumentLoadingState, stateFromTokenForLoggedInUserFunction, storageFileUploadFiles, storageFileUploadHandler };
9739
10764
  //# sourceMappingURL=dereekb-dbx-firebase.mjs.map