@angular/fire 18.0.0 → 18.0.1
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.
- package/esm2022/analytics/analytics.module.mjs +5 -5
- package/esm2022/analytics/screen-tracking.service.mjs +4 -4
- package/esm2022/analytics/user-tracking.service.mjs +4 -4
- package/esm2022/app/app.module.mjs +5 -5
- package/esm2022/app-check/app-check.module.mjs +5 -5
- package/esm2022/auth/auth.module.mjs +5 -5
- package/esm2022/auth-guard/auth-guard.mjs +4 -4
- package/esm2022/auth-guard/auth-guard.module.mjs +5 -5
- package/esm2022/compat/analytics/analytics.mjs +4 -4
- package/esm2022/compat/analytics/analytics.module.mjs +5 -5
- package/esm2022/compat/analytics/screen-tracking.service.mjs +4 -4
- package/esm2022/compat/analytics/user-tracking.service.mjs +4 -4
- package/esm2022/compat/auth/auth.mjs +4 -4
- package/esm2022/compat/auth/auth.module.mjs +5 -5
- package/esm2022/compat/auth-guard/auth-guard.mjs +4 -4
- package/esm2022/compat/auth-guard/auth-guard.module.mjs +5 -5
- package/esm2022/compat/database/database.mjs +4 -4
- package/esm2022/compat/database/database.module.mjs +5 -5
- package/esm2022/compat/firebase.app.module.mjs +5 -5
- package/esm2022/compat/firestore/firestore.mjs +4 -4
- package/esm2022/compat/firestore/firestore.module.mjs +5 -5
- package/esm2022/compat/functions/functions.mjs +4 -4
- package/esm2022/compat/functions/functions.module.mjs +5 -5
- package/esm2022/compat/messaging/messaging.mjs +4 -4
- package/esm2022/compat/messaging/messaging.module.mjs +5 -5
- package/esm2022/compat/performance/performance.mjs +4 -4
- package/esm2022/compat/performance/performance.module.mjs +5 -5
- package/esm2022/compat/performance/performance.service.mjs +4 -4
- package/esm2022/compat/remote-config/remote-config.mjs +4 -4
- package/esm2022/compat/remote-config/remote-config.module.mjs +5 -5
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +8 -8
- package/esm2022/compat/storage/storage.mjs +4 -4
- package/esm2022/compat/storage/storage.module.mjs +5 -5
- package/esm2022/database/database.module.mjs +5 -5
- package/esm2022/firestore/firestore.module.mjs +5 -5
- package/esm2022/firestore/lite/lite.module.mjs +5 -5
- package/esm2022/functions/functions.module.mjs +5 -5
- package/esm2022/messaging/messaging.module.mjs +5 -5
- package/esm2022/performance/performance.module.mjs +5 -5
- package/esm2022/remote-config/remote-config.module.mjs +5 -5
- package/esm2022/storage/storage.module.mjs +5 -5
- package/esm2022/vertexai-preview/vertexai.module.mjs +5 -5
- package/esm2022/zones.mjs +4 -4
- package/fesm2022/angular-fire-analytics.mjs +297 -410
- package/fesm2022/angular-fire-analytics.mjs.map +1 -7
- package/fesm2022/angular-fire-app-check.mjs +91 -162
- package/fesm2022/angular-fire-app-check.mjs.map +1 -7
- package/fesm2022/angular-fire-app.mjs +108 -181
- package/fesm2022/angular-fire-app.mjs.map +1 -7
- package/fesm2022/angular-fire-auth-guard.mjs +73 -83
- package/fesm2022/angular-fire-auth-guard.mjs.map +1 -7
- package/fesm2022/angular-fire-auth.mjs +142 -421
- package/fesm2022/angular-fire-auth.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-analytics.mjs +271 -262
- package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-auth-guard.mjs +72 -83
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-auth.mjs +214 -215
- package/fesm2022/angular-fire-compat-auth.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-database.mjs +378 -375
- package/fesm2022/angular-fire-compat-database.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-firestore.mjs +677 -537
- package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-functions.mjs +94 -98
- package/fesm2022/angular-fire-compat-functions.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-messaging.mjs +107 -107
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-performance.mjs +152 -158
- package/fesm2022/angular-fire-compat-performance.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-remote-config.mjs +232 -216
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -7
- package/fesm2022/angular-fire-compat-storage.mjs +231 -226
- package/fesm2022/angular-fire-compat-storage.mjs.map +1 -7
- package/fesm2022/angular-fire-compat.mjs +153 -140
- package/fesm2022/angular-fire-compat.mjs.map +1 -7
- package/fesm2022/angular-fire-database.mjs +136 -376
- package/fesm2022/angular-fire-database.mjs.map +1 -7
- package/fesm2022/angular-fire-firestore-lite.mjs +139 -388
- package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -7
- package/fesm2022/angular-fire-firestore.mjs +167 -526
- package/fesm2022/angular-fire-firestore.mjs.map +1 -7
- package/fesm2022/angular-fire-functions.mjs +93 -166
- package/fesm2022/angular-fire-functions.mjs.map +1 -7
- package/fesm2022/angular-fire-messaging.mjs +118 -196
- package/fesm2022/angular-fire-messaging.mjs.map +1 -7
- package/fesm2022/angular-fire-performance.mjs +104 -178
- package/fesm2022/angular-fire-performance.mjs.map +1 -7
- package/fesm2022/angular-fire-remote-config.mjs +132 -254
- package/fesm2022/angular-fire-remote-config.mjs.map +1 -7
- package/fesm2022/angular-fire-storage.mjs +105 -225
- package/fesm2022/angular-fire-storage.mjs.map +1 -7
- package/fesm2022/angular-fire-vertexai-preview.mjs +85 -146
- package/fesm2022/angular-fire-vertexai-preview.mjs.map +1 -7
- package/fesm2022/angular-fire.mjs +213 -183
- package/fesm2022/angular-fire.mjs.map +1 -7
- package/package.json +1 -1
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/compat/performance/base.ts", "../../../src/compat/performance/performance.ts", "../../../src/compat/performance/performance.service.ts", "../../../src/compat/performance/performance.module.ts"],
|
|
4
|
-
"sourcesContent": ["// DO NOT MODIFY, this file is autogenerated by tools/build.ts\n// Export a null object with the same keys as firebase/compat/performance, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n app: null,\n trace: null,\n instrumentationEnabled: null,\n dataCollectionEnabled: null,\n};\n", "import { isPlatformBrowser } from '@angular/common';\nimport { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';\nimport { ɵPromiseProxy, ɵapplyMixins, ɵcacheInstance, ɵlazySDKProxy } from '@angular/fire/compat';\nimport { FirebaseApp } from '@angular/fire/compat';\nimport firebase from 'firebase/compat/app';\nimport { EMPTY, Observable, Subscription, of } from 'rxjs';\nimport { map, shareReplay, switchMap, tap } from 'rxjs/operators';\nimport { proxyPolyfillCompat } from './base';\n\nexport const INSTRUMENTATION_ENABLED = new InjectionToken<boolean>('angularfire2.performance.instrumentationEnabled');\nexport const DATA_COLLECTION_ENABLED = new InjectionToken<boolean>('angularfire2.performance.dataCollectionEnabled');\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface AngularFirePerformance extends ɵPromiseProxy<firebase.performance.Performance> {\n}\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFirePerformance {\n\n private readonly performance: Observable<firebase.performance.Performance>;\n\n constructor(\n app: FirebaseApp,\n @Optional() @Inject(INSTRUMENTATION_ENABLED) instrumentationEnabled: boolean | null,\n @Optional() @Inject(DATA_COLLECTION_ENABLED) dataCollectionEnabled: boolean | null,\n private zone: NgZone,\n // eslint-disable-next-line @typescript-eslint/ban-types\n @Inject(PLATFORM_ID) platformId: Object\n ) {\n\n this.performance = of(undefined).pipe(\n switchMap(() => isPlatformBrowser(platformId) ? zone.runOutsideAngular(() => import('firebase/compat/performance')) : EMPTY),\n map(() => ɵcacheInstance(`performance`, 'AngularFirePerformance', app.name, () => {\n const performance = zone.runOutsideAngular(() => app.performance());\n if (instrumentationEnabled === false) {\n performance.instrumentationEnabled = false;\n }\n if (dataCollectionEnabled === false) {\n performance.dataCollectionEnabled = false;\n }\n return performance;\n }, [instrumentationEnabled, dataCollectionEnabled])),\n shareReplay({ bufferSize: 1, refCount: false })\n );\n\n return ɵlazySDKProxy(this, this.performance, zone);\n\n }\n\n}\n\nconst trace$ = (traceId: string) => {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (typeof window !== 'undefined' && window.performance?.mark) {\n const entries = window.performance.getEntriesByName(traceId, 'measure') || [];\n const startMarkName = `_${traceId}Start[${entries.length}]`;\n const endMarkName = `_${traceId}End[${entries.length}]`;\n return new Observable<void>(emitter => {\n window.performance.mark(startMarkName);\n emitter.next();\n return {\n unsubscribe: () => {\n window.performance.mark(endMarkName);\n window.performance.measure(traceId, startMarkName, endMarkName);\n }\n };\n });\n } else {\n return EMPTY;\n }\n};\n\nexport const traceUntil = <T = any>(\n name: string,\n test: (a: T) => boolean,\n options?: { orComplete?: boolean }\n) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n const traceSubscription = trace$(name).subscribe();\n return source$.pipe(\n tap(\n a => test(a) && traceSubscription.unsubscribe(),\n () => undefined,\n () => options && options.orComplete && traceSubscription.unsubscribe()\n )\n ).subscribe(subscriber);\n});\n\nexport const traceWhile = <T = any>(\n name: string,\n test: (a: T) => boolean,\n options?: { orComplete?: boolean }\n) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n let traceSubscription: Subscription | undefined;\n return source$.pipe(\n tap(\n a => {\n if (test(a)) {\n traceSubscription = traceSubscription || trace$(name).subscribe();\n } else {\n if (traceSubscription) {\n traceSubscription.unsubscribe();\n }\n\n traceSubscription = undefined;\n }\n },\n () => undefined,\n () => options && options.orComplete && traceSubscription && traceSubscription.unsubscribe()\n )\n ).subscribe(subscriber);\n});\n\nexport const traceUntilComplete = <T = any>(name: string) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n const traceSubscription = trace$(name).subscribe();\n return source$.pipe(\n tap(\n () => undefined,\n () => undefined,\n () => traceSubscription.unsubscribe()\n )\n ).subscribe(subscriber);\n});\n\nexport const traceUntilFirst = <T = any>(name: string) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n const traceSubscription = trace$(name).subscribe();\n return source$.pipe(\n tap(\n () => traceSubscription.unsubscribe(),\n () => undefined,\n () => undefined )\n ).subscribe(subscriber);\n});\n\nexport const trace = <T = any>(name: string) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n const traceSubscription = trace$(name).subscribe();\n return source$.pipe(\n tap(\n () => traceSubscription.unsubscribe(),\n () => undefined,\n () => traceSubscription.unsubscribe()\n )\n ).subscribe(subscriber);\n});\n\nɵapplyMixins(AngularFirePerformance, [proxyPolyfillCompat]);\n", "import { ApplicationRef, Injectable, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\n\nconst IS_STABLE_START_MARK = 'Zone';\nconst IS_STABLE_END_MARK = '_isStableEnd';\n\n@Injectable()\nexport class PerformanceMonitoringService implements OnDestroy {\n\n private disposable: Subscription|undefined;\n\n constructor(appRef: ApplicationRef) {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (typeof window !== 'undefined' && window.performance?.mark) {\n this.disposable = appRef.isStable.pipe(\n first(it => it),\n tap(() => {\n window.performance.mark(IS_STABLE_END_MARK);\n window.performance.measure('isStable', IS_STABLE_START_MARK, IS_STABLE_END_MARK);\n })\n ).subscribe();\n }\n }\n\n ngOnDestroy() {\n if (this.disposable) { this.disposable.unsubscribe(); }\n }\n\n}\n", "import { NgModule, Optional } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFirePerformance } from './performance';\nimport { PerformanceMonitoringService } from './performance.service';\n\n@NgModule({\n providers: [ AngularFirePerformance ]\n})\nexport class AngularFirePerformanceModule {\n constructor(\n perf: AngularFirePerformance,\n @Optional() _: PerformanceMonitoringService\n ) {\n firebase.registerVersion('angularfire', VERSION.full, 'perf-compat');\n // call anything here to get perf loading\n perf.dataCollectionEnabled.then(() => undefined);\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAEO,IAAM,sBAA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AE,WAAK,WAAW,YAAW;IAAI;EAC1D;4GAnBS,+BAA4B,MAAA,CAAA,EAAA,OAAA,mBAAA,CAAA,GAAA,QAAA,oBAAA,WAAA,CAAA;gHAA5B,8BAA4B,CAAA;;kGAA5B,8BAA4B,YAAA,CAAA;QADxCD;;;;ACPD,SAAS,UAAU,YAAAE,iBAAgB;AACnC,SAAS,eAAe;AACxB,OAAO,cAAc;;AAOf,IAAO,+BAAP,MAAO,8BAA4B;EACvC,YACE,MACY,GAA+B;AAE3C,aAAS,gBAAgB,eAAe,QAAQ,MAAM,aAAa;AAEnE,SAAK,sBAAsB,KAAK,MAAM,MAAS;EACjD;4GARW,+BAA4B,MAAA,CAAA,EAAA,OAAA,uBAAA,GAAA,EAAA,OAAA,8BAAA,UAAA,KAAA,CAAA,GAAA,QAAA,oBAAA,SAAA,CAAA;6GAA5B,8BAA4B,CAAA;6GAA5B,+BAA4B,WAF5B,CAAE,sBAAsB,EAAE,CAAA;;kGAE1B,8BAA4B,YAAA,CAAA;QAHxC;SAAS;IACR,WAAW,CAAE,sBAAsB;GACpC;;QAIIA;;",
|
|
6
|
-
"names": ["Injectable", "tap", "Optional"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"angular-fire-compat-performance.mjs","sources":["../../../src/compat/performance/base.ts","../../../src/compat/performance/performance.ts","../../../src/compat/performance/performance.service.ts","../../../src/compat/performance/performance.module.ts","../../../src/compat/performance/angular-fire-compat-performance.ts"],"sourcesContent":["// DO NOT MODIFY, this file is autogenerated by tools/build.ts\n// Export a null object with the same keys as firebase/compat/performance, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n app: null,\n trace: null,\n instrumentationEnabled: null,\n dataCollectionEnabled: null,\n};\n","import { isPlatformBrowser } from '@angular/common';\nimport { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';\nimport { ɵPromiseProxy, ɵapplyMixins, ɵcacheInstance, ɵlazySDKProxy } from '@angular/fire/compat';\nimport { FirebaseApp } from '@angular/fire/compat';\nimport firebase from 'firebase/compat/app';\nimport { EMPTY, Observable, Subscription, of } from 'rxjs';\nimport { map, shareReplay, switchMap, tap } from 'rxjs/operators';\nimport { proxyPolyfillCompat } from './base';\n\nexport const INSTRUMENTATION_ENABLED = new InjectionToken<boolean>('angularfire2.performance.instrumentationEnabled');\nexport const DATA_COLLECTION_ENABLED = new InjectionToken<boolean>('angularfire2.performance.dataCollectionEnabled');\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface AngularFirePerformance extends ɵPromiseProxy<firebase.performance.Performance> {\n}\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFirePerformance {\n\n private readonly performance: Observable<firebase.performance.Performance>;\n\n constructor(\n app: FirebaseApp,\n @Optional() @Inject(INSTRUMENTATION_ENABLED) instrumentationEnabled: boolean | null,\n @Optional() @Inject(DATA_COLLECTION_ENABLED) dataCollectionEnabled: boolean | null,\n private zone: NgZone,\n // eslint-disable-next-line @typescript-eslint/ban-types\n @Inject(PLATFORM_ID) platformId: Object\n ) {\n\n this.performance = of(undefined).pipe(\n switchMap(() => isPlatformBrowser(platformId) ? zone.runOutsideAngular(() => import('firebase/compat/performance')) : EMPTY),\n map(() => ɵcacheInstance(`performance`, 'AngularFirePerformance', app.name, () => {\n const performance = zone.runOutsideAngular(() => app.performance());\n if (instrumentationEnabled === false) {\n performance.instrumentationEnabled = false;\n }\n if (dataCollectionEnabled === false) {\n performance.dataCollectionEnabled = false;\n }\n return performance;\n }, [instrumentationEnabled, dataCollectionEnabled])),\n shareReplay({ bufferSize: 1, refCount: false })\n );\n\n return ɵlazySDKProxy(this, this.performance, zone);\n\n }\n\n}\n\nconst trace$ = (traceId: string) => {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (typeof window !== 'undefined' && window.performance?.mark) {\n const entries = window.performance.getEntriesByName(traceId, 'measure') || [];\n const startMarkName = `_${traceId}Start[${entries.length}]`;\n const endMarkName = `_${traceId}End[${entries.length}]`;\n return new Observable<void>(emitter => {\n window.performance.mark(startMarkName);\n emitter.next();\n return {\n unsubscribe: () => {\n window.performance.mark(endMarkName);\n window.performance.measure(traceId, startMarkName, endMarkName);\n }\n };\n });\n } else {\n return EMPTY;\n }\n};\n\nexport const traceUntil = <T = any>(\n name: string,\n test: (a: T) => boolean,\n options?: { orComplete?: boolean }\n) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n const traceSubscription = trace$(name).subscribe();\n return source$.pipe(\n tap(\n a => test(a) && traceSubscription.unsubscribe(),\n () => undefined,\n () => options && options.orComplete && traceSubscription.unsubscribe()\n )\n ).subscribe(subscriber);\n});\n\nexport const traceWhile = <T = any>(\n name: string,\n test: (a: T) => boolean,\n options?: { orComplete?: boolean }\n) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n let traceSubscription: Subscription | undefined;\n return source$.pipe(\n tap(\n a => {\n if (test(a)) {\n traceSubscription = traceSubscription || trace$(name).subscribe();\n } else {\n if (traceSubscription) {\n traceSubscription.unsubscribe();\n }\n\n traceSubscription = undefined;\n }\n },\n () => undefined,\n () => options && options.orComplete && traceSubscription && traceSubscription.unsubscribe()\n )\n ).subscribe(subscriber);\n});\n\nexport const traceUntilComplete = <T = any>(name: string) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n const traceSubscription = trace$(name).subscribe();\n return source$.pipe(\n tap(\n () => undefined,\n () => undefined,\n () => traceSubscription.unsubscribe()\n )\n ).subscribe(subscriber);\n});\n\nexport const traceUntilFirst = <T = any>(name: string) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n const traceSubscription = trace$(name).subscribe();\n return source$.pipe(\n tap(\n () => traceSubscription.unsubscribe(),\n () => undefined,\n () => undefined )\n ).subscribe(subscriber);\n});\n\nexport const trace = <T = any>(name: string) => (source$: Observable<T>) => new Observable<T>(subscriber => {\n const traceSubscription = trace$(name).subscribe();\n return source$.pipe(\n tap(\n () => traceSubscription.unsubscribe(),\n () => undefined,\n () => traceSubscription.unsubscribe()\n )\n ).subscribe(subscriber);\n});\n\nɵapplyMixins(AngularFirePerformance, [proxyPolyfillCompat]);\n","import { ApplicationRef, Injectable, OnDestroy } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\n\nconst IS_STABLE_START_MARK = 'Zone';\nconst IS_STABLE_END_MARK = '_isStableEnd';\n\n@Injectable()\nexport class PerformanceMonitoringService implements OnDestroy {\n\n private disposable: Subscription|undefined;\n\n constructor(appRef: ApplicationRef) {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (typeof window !== 'undefined' && window.performance?.mark) {\n this.disposable = appRef.isStable.pipe(\n first(it => it),\n tap(() => {\n window.performance.mark(IS_STABLE_END_MARK);\n window.performance.measure('isStable', IS_STABLE_START_MARK, IS_STABLE_END_MARK);\n })\n ).subscribe();\n }\n }\n\n ngOnDestroy() {\n if (this.disposable) { this.disposable.unsubscribe(); }\n }\n\n}\n","import { NgModule, Optional } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFirePerformance } from './performance';\nimport { PerformanceMonitoringService } from './performance.service';\n\n@NgModule({\n providers: [ AngularFirePerformance ]\n})\nexport class AngularFirePerformanceModule {\n constructor(\n perf: AngularFirePerformance,\n @Optional() _: PerformanceMonitoringService\n ) {\n firebase.registerVersion('angularfire', VERSION.full, 'perf-compat');\n // call anything here to get perf loading\n perf.dataCollectionEnabled.then(() => undefined);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ɵcacheInstance","ɵlazySDKProxy","ɵapplyMixins","i1.AngularFirePerformance","i2.PerformanceMonitoringService"],"mappings":";;;;;;;;;;AAAA;AACA;AACO,MAAM,mBAAmB,GAAG;AACjC,IAAA,GAAG,EAAE,IAAI;AACT,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,sBAAsB,EAAE,IAAI;AAC5B,IAAA,qBAAqB,EAAE,IAAI;CAC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E,4BAA4B,CAAA;IACvC,WACE,CAAA,IAA4B,EAChB,CAA+B,EAAA;QAE3C,QAAQ,CAAC,eAAe,CAAC,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;;QAErE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC,CAAC;KAClD;uGARU,4BAA4B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,sBAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,4BAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;wGAA5B,4BAA4B,EAAA,CAAA,CAAA;wGAA5B,4BAA4B,EAAA,SAAA,EAF5B,CAAE,sBAAsB,CAAE,EAAA,CAAA,CAAA;;2FAE1B,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBAHxC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,SAAS,EAAE,CAAE,sBAAsB,CAAE;AACtC,iBAAA,CAAA;;0BAII,QAAQ;;;ACZb;;AAEG;;;;"}
|
|
@@ -1,231 +1,247 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, PLATFORM_ID, Injectable, Inject, Optional, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/fire';
|
|
4
|
+
import { keepUnstableUntilFirst, VERSION } from '@angular/fire';
|
|
5
|
+
import { ɵfirebaseAppFactory as _firebaseAppFactory, ɵcacheInstance as _cacheInstance, ɵlazySDKProxy as _lazySDKProxy, FIREBASE_OPTIONS, FIREBASE_APP_NAME, ɵapplyMixins as _applyMixins } from '@angular/fire/compat';
|
|
6
|
+
import { isSupported } from 'firebase/remote-config';
|
|
7
|
+
import { pipe, of, EMPTY, concat, Observable } from 'rxjs';
|
|
8
|
+
import { map, distinctUntilChanged, filter, withLatestFrom, scan, observeOn, switchMap, startWith, shareReplay, groupBy, mergeMap, debounceTime } from 'rxjs/operators';
|
|
9
|
+
import firebase from 'firebase/compat/app';
|
|
10
|
+
|
|
11
|
+
// DO NOT MODIFY, this file is autogenerated by tools/build.ts
|
|
12
|
+
// Export a null object with the same keys as firebase/compat/remote-config, so Proxy can work with proxy-polyfill in Internet Explorer
|
|
13
|
+
const proxyPolyfillCompat = {
|
|
14
|
+
app: null,
|
|
15
|
+
settings: null,
|
|
16
|
+
defaultConfig: null,
|
|
17
|
+
fetchTimeMillis: null,
|
|
18
|
+
lastFetchStatus: null,
|
|
19
|
+
activate: null,
|
|
20
|
+
ensureInitialized: null,
|
|
21
|
+
fetch: null,
|
|
22
|
+
fetchAndActivate: null,
|
|
23
|
+
getAll: null,
|
|
24
|
+
getBoolean: null,
|
|
25
|
+
getNumber: null,
|
|
26
|
+
getString: null,
|
|
27
|
+
getValue: null,
|
|
28
|
+
setLogLevel: null,
|
|
18
29
|
};
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import { debounceTime, distinctUntilChanged, filter, groupBy, map, mergeMap, observeOn, scan, shareReplay, startWith, switchMap, withLatestFrom } from "rxjs/operators";
|
|
28
|
-
import * as i0 from "@angular/core";
|
|
29
|
-
import * as i1 from "@angular/fire";
|
|
30
|
-
var SETTINGS = new InjectionToken("angularfire2.remoteConfig.settings");
|
|
31
|
-
var DEFAULTS = new InjectionToken("angularfire2.remoteConfig.defaultConfig");
|
|
32
|
-
var AS_TO_FN = { strings: "asString", numbers: "asNumber", booleans: "asBoolean" };
|
|
33
|
-
var STATIC_VALUES = { numbers: 0, booleans: false, strings: void 0 };
|
|
34
|
-
var proxyAll = (observable, as) => new Proxy(observable.pipe(mapToObject(as)), {
|
|
35
|
-
get: (self, name) => self[name] || observable.pipe(map((all) => all.find((p) => p.key === name)), map((param) => param ? param[AS_TO_FN[as]]() : STATIC_VALUES[as]), distinctUntilChanged())
|
|
31
|
+
const SETTINGS = new InjectionToken('angularfire2.remoteConfig.settings');
|
|
32
|
+
const DEFAULTS = new InjectionToken('angularfire2.remoteConfig.defaultConfig');
|
|
33
|
+
const AS_TO_FN = { strings: 'asString', numbers: 'asNumber', booleans: 'asBoolean' };
|
|
34
|
+
const STATIC_VALUES = { numbers: 0, booleans: false, strings: undefined };
|
|
35
|
+
// TODO look into the types here, I don't like the anys
|
|
36
|
+
const proxyAll = (observable, as) => new Proxy(observable.pipe(mapToObject(as)), {
|
|
37
|
+
get: (self, name) => self[name] || observable.pipe(map(all => all.find(p => p.key === name)), map(param => param ? param[AS_TO_FN[as]]() : STATIC_VALUES[as]), distinctUntilChanged())
|
|
36
38
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
39
|
+
// TODO export as implements Partial<...> so minor doesn't break us
|
|
40
|
+
class Value {
|
|
41
|
+
_source;
|
|
42
|
+
_value;
|
|
43
|
+
asBoolean() {
|
|
44
|
+
return ['1', 'true', 't', 'y', 'yes', 'on'].indexOf(this._value.toLowerCase()) > -1;
|
|
45
|
+
}
|
|
46
|
+
asString() {
|
|
47
|
+
return this._value;
|
|
48
|
+
}
|
|
49
|
+
asNumber() {
|
|
50
|
+
return Number(this._value) || 0;
|
|
51
|
+
}
|
|
52
|
+
getSource() {
|
|
53
|
+
return this._source;
|
|
54
|
+
}
|
|
55
|
+
constructor(_source, _value) {
|
|
56
|
+
this._source = _source;
|
|
57
|
+
this._value = _value;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// SEMVER use ConstructorParameters when we can support Typescript 3.6
|
|
61
|
+
class Parameter extends Value {
|
|
62
|
+
key;
|
|
63
|
+
fetchTimeMillis;
|
|
64
|
+
constructor(key, fetchTimeMillis, source, value) {
|
|
65
|
+
super(source, value);
|
|
66
|
+
this.key = key;
|
|
67
|
+
this.fetchTimeMillis = fetchTimeMillis;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// If it's a Parameter array, test any, else test the individual Parameter
|
|
71
|
+
const filterTest = (fn) => filter(it => Array.isArray(it) ? it.some(fn) : fn(it));
|
|
72
|
+
// Allow the user to bypass the default values and wait till they get something from the server, even if it's a cached copy;
|
|
73
|
+
// if used in conjuntion with first() it will only fetch RC values from the server if they aren't cached locally
|
|
74
|
+
const filterRemote = () => filterTest(p => p.getSource() === 'remote');
|
|
75
|
+
// filterFresh allows the developer to effectively set up a maximum cache time
|
|
76
|
+
const filterFresh = (howRecentInMillis) => filterTest(p => p.fetchTimeMillis + howRecentInMillis >= new Date().getTime());
|
|
77
|
+
// I ditched loading the defaults into RC and a simple map for scan since we already have our own defaults implementation.
|
|
78
|
+
// The idea here being that if they have a default that never loads from the server, they will be able to tell via fetchTimeMillis
|
|
79
|
+
// on the Parameter. Also if it doesn't come from the server it won't emit again in .changes, due to the distinctUntilChanged,
|
|
80
|
+
// which we can simplify to === rather than deep comparison
|
|
81
|
+
const scanToParametersArray = (remoteConfig) => pipe(withLatestFrom(remoteConfig), scan((existing, [all, rc]) => {
|
|
82
|
+
// SEMVER use "new Set" to unique once we're only targeting es6
|
|
83
|
+
// at the scale we expect remote config to be at, we probably won't see a performance hit from this unoptimized uniqueness
|
|
84
|
+
// implementation.
|
|
85
|
+
// const allKeys = [...new Set([...existing.map(p => p.key), ...Object.keys(all)])];
|
|
86
|
+
const allKeys = [...existing.map(p => p.key), ...Object.keys(all)].filter((v, i, a) => a.indexOf(v) === i);
|
|
87
|
+
return allKeys.map(key => {
|
|
88
|
+
const updatedValue = all[key];
|
|
89
|
+
return updatedValue ? new Parameter(key, rc ? rc.fetchTimeMillis : -1, updatedValue.getSource(), updatedValue.asString())
|
|
90
|
+
: existing.find(p => p.key === key);
|
|
91
|
+
});
|
|
75
92
|
}, []));
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
type: Inject,
|
|
117
|
-
args: [FIREBASE_OPTIONS]
|
|
118
|
-
}] }, { type: void 0, decorators: [{
|
|
119
|
-
type: Optional
|
|
120
|
-
}, {
|
|
121
|
-
type: Inject,
|
|
122
|
-
args: [FIREBASE_APP_NAME]
|
|
123
|
-
}] }, { type: void 0, decorators: [{
|
|
124
|
-
type: Optional
|
|
125
|
-
}, {
|
|
126
|
-
type: Inject,
|
|
127
|
-
args: [SETTINGS]
|
|
128
|
-
}] }, { type: void 0, decorators: [{
|
|
129
|
-
type: Optional
|
|
130
|
-
}, {
|
|
131
|
-
type: Inject,
|
|
132
|
-
args: [DEFAULTS]
|
|
133
|
-
}] }, { type: i0.NgZone }, { type: i1.ɵAngularFireSchedulers }, { type: Object, decorators: [{
|
|
134
|
-
type: Inject,
|
|
135
|
-
args: [PLATFORM_ID]
|
|
136
|
-
}] }] });
|
|
137
|
-
var budget = (interval) => (source) => new Observable((observer) => {
|
|
138
|
-
let timedOut = false;
|
|
139
|
-
const timeout = setTimeout(() => {
|
|
140
|
-
observer.complete();
|
|
141
|
-
timedOut = true;
|
|
142
|
-
}, interval);
|
|
143
|
-
return source.subscribe({
|
|
144
|
-
next(val) {
|
|
145
|
-
if (!timedOut) {
|
|
146
|
-
observer.next(val);
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
error(err) {
|
|
150
|
-
if (!timedOut) {
|
|
151
|
-
clearTimeout(timeout);
|
|
152
|
-
observer.error(err);
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
complete() {
|
|
156
|
-
if (!timedOut) {
|
|
157
|
-
clearTimeout(timeout);
|
|
158
|
-
observer.complete();
|
|
159
|
-
}
|
|
93
|
+
class AngularFireRemoteConfig {
|
|
94
|
+
zone;
|
|
95
|
+
changes;
|
|
96
|
+
parameters;
|
|
97
|
+
numbers;
|
|
98
|
+
booleans;
|
|
99
|
+
strings;
|
|
100
|
+
constructor(options, name, settings, defaultConfig, zone, schedulers,
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-types
|
|
102
|
+
platformId) {
|
|
103
|
+
this.zone = zone;
|
|
104
|
+
const remoteConfig$ = of(undefined).pipe(observeOn(schedulers.outsideAngular), switchMap(() => isSupported()), switchMap(isSupported => isSupported ? import('firebase/compat/remote-config') : EMPTY), map(() => _firebaseAppFactory(options, zone, name)), map(app => _cacheInstance(`${app.name}.remote-config`, 'AngularFireRemoteConfig', app.name, () => {
|
|
105
|
+
const rc = app.remoteConfig();
|
|
106
|
+
if (settings) {
|
|
107
|
+
rc.settings = settings;
|
|
108
|
+
}
|
|
109
|
+
if (defaultConfig) {
|
|
110
|
+
rc.defaultConfig = defaultConfig;
|
|
111
|
+
}
|
|
112
|
+
return rc;
|
|
113
|
+
}, [settings, defaultConfig])), startWith(undefined), shareReplay({ bufferSize: 1, refCount: false }));
|
|
114
|
+
const loadedRemoteConfig$ = remoteConfig$.pipe(filter(rc => !!rc));
|
|
115
|
+
const default$ = of(Object.keys(defaultConfig || {}).reduce((c, k) => ({ ...c, [k]: new Value('default', defaultConfig[k].toString()) }), {}));
|
|
116
|
+
// we should filter out the defaults we provided to RC, since we have our own implementation
|
|
117
|
+
// that gives us a -1 for fetchTimeMillis (so filterFresh can filter them out)
|
|
118
|
+
const filterOutDefaults = map(all => Object.keys(all)
|
|
119
|
+
.filter(key => all[key].getSource() !== 'default')
|
|
120
|
+
.reduce((acc, key) => ({ ...acc, [key]: all[key] }), {}));
|
|
121
|
+
const existing$ = loadedRemoteConfig$.pipe(switchMap(rc => rc.activate()
|
|
122
|
+
.then(() => rc.ensureInitialized())
|
|
123
|
+
.then(() => rc.getAll())), filterOutDefaults);
|
|
124
|
+
const fresh$ = loadedRemoteConfig$.pipe(switchMap(rc => zone.runOutsideAngular(() => rc.fetchAndActivate()
|
|
125
|
+
.then(() => rc.ensureInitialized())
|
|
126
|
+
.then(() => rc.getAll()))), filterOutDefaults);
|
|
127
|
+
this.parameters = concat(default$, existing$, fresh$).pipe(scanToParametersArray(remoteConfig$), keepUnstableUntilFirst, shareReplay({ bufferSize: 1, refCount: true }));
|
|
128
|
+
this.changes = this.parameters.pipe(switchMap(params => of(...params)), groupBy(param => param.key), mergeMap(group => group.pipe(distinctUntilChanged())));
|
|
129
|
+
this.strings = proxyAll(this.parameters, 'strings');
|
|
130
|
+
this.booleans = proxyAll(this.parameters, 'booleans');
|
|
131
|
+
this.numbers = proxyAll(this.parameters, 'numbers');
|
|
132
|
+
return _lazySDKProxy(this, loadedRemoteConfig$, zone);
|
|
160
133
|
}
|
|
161
|
-
|
|
134
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireRemoteConfig, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: SETTINGS, optional: true }, { token: DEFAULTS, optional: true }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
135
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireRemoteConfig, providedIn: 'any' });
|
|
136
|
+
}
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireRemoteConfig, decorators: [{
|
|
138
|
+
type: Injectable,
|
|
139
|
+
args: [{
|
|
140
|
+
providedIn: 'any'
|
|
141
|
+
}]
|
|
142
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
143
|
+
type: Inject,
|
|
144
|
+
args: [FIREBASE_OPTIONS]
|
|
145
|
+
}] }, { type: undefined, decorators: [{
|
|
146
|
+
type: Optional
|
|
147
|
+
}, {
|
|
148
|
+
type: Inject,
|
|
149
|
+
args: [FIREBASE_APP_NAME]
|
|
150
|
+
}] }, { type: undefined, decorators: [{
|
|
151
|
+
type: Optional
|
|
152
|
+
}, {
|
|
153
|
+
type: Inject,
|
|
154
|
+
args: [SETTINGS]
|
|
155
|
+
}] }, { type: undefined, decorators: [{
|
|
156
|
+
type: Optional
|
|
157
|
+
}, {
|
|
158
|
+
type: Inject,
|
|
159
|
+
args: [DEFAULTS]
|
|
160
|
+
}] }, { type: i0.NgZone }, { type: i1.ɵAngularFireSchedulers }, { type: Object, decorators: [{
|
|
161
|
+
type: Inject,
|
|
162
|
+
args: [PLATFORM_ID]
|
|
163
|
+
}] }] });
|
|
164
|
+
const budget = (interval) => (source) => new Observable(observer => {
|
|
165
|
+
let timedOut = false;
|
|
166
|
+
// TODO use scheduler task rather than settimeout
|
|
167
|
+
const timeout = setTimeout(() => {
|
|
168
|
+
observer.complete();
|
|
169
|
+
timedOut = true;
|
|
170
|
+
}, interval);
|
|
171
|
+
return source.subscribe({
|
|
172
|
+
next(val) {
|
|
173
|
+
if (!timedOut) {
|
|
174
|
+
observer.next(val);
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
error(err) {
|
|
178
|
+
if (!timedOut) {
|
|
179
|
+
clearTimeout(timeout);
|
|
180
|
+
observer.error(err);
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
complete() {
|
|
184
|
+
if (!timedOut) {
|
|
185
|
+
clearTimeout(timeout);
|
|
186
|
+
observer.complete();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
162
190
|
});
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
const typedMethod = (it) => {
|
|
192
|
+
switch (typeof it) {
|
|
193
|
+
case 'string':
|
|
194
|
+
return 'asString';
|
|
195
|
+
case 'boolean':
|
|
196
|
+
return 'asBoolean';
|
|
197
|
+
case 'number':
|
|
198
|
+
return 'asNumber';
|
|
199
|
+
default:
|
|
200
|
+
return 'asString';
|
|
201
|
+
}
|
|
174
202
|
};
|
|
175
|
-
function scanToObject(to =
|
|
176
|
-
|
|
203
|
+
function scanToObject(to = 'strings') {
|
|
204
|
+
return pipe(
|
|
177
205
|
// TODO cleanup
|
|
178
206
|
scan((c, p) => ({
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
);
|
|
207
|
+
...c, [p.key]: typeof to === 'object' ?
|
|
208
|
+
p[typedMethod(to[p.key])]() :
|
|
209
|
+
p[AS_TO_FN[to]]()
|
|
210
|
+
}), typeof to === 'object' ?
|
|
211
|
+
to :
|
|
212
|
+
{}), debounceTime(1), budget(10), distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)));
|
|
186
213
|
}
|
|
187
|
-
function mapToObject(to =
|
|
188
|
-
|
|
214
|
+
function mapToObject(to = 'strings') {
|
|
215
|
+
return pipe(
|
|
189
216
|
// TODO this is getting a little long, cleanup
|
|
190
217
|
map((params) => params.reduce((c, p) => ({
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
218
|
+
...c, [p.key]: typeof to === 'object' ?
|
|
219
|
+
p[typedMethod(to[p.key])]() :
|
|
220
|
+
p[AS_TO_FN[to]]()
|
|
221
|
+
}), typeof to === 'object' ?
|
|
222
|
+
to :
|
|
223
|
+
{})), distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)));
|
|
196
224
|
}
|
|
197
|
-
|
|
225
|
+
_applyMixins(AngularFireRemoteConfig, [proxyPolyfillCompat]);
|
|
198
226
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
export {
|
|
219
|
-
AngularFireRemoteConfig,
|
|
220
|
-
AngularFireRemoteConfigModule,
|
|
221
|
-
DEFAULTS,
|
|
222
|
-
Parameter,
|
|
223
|
-
SETTINGS,
|
|
224
|
-
Value,
|
|
225
|
-
budget,
|
|
226
|
-
filterFresh,
|
|
227
|
-
filterRemote,
|
|
228
|
-
mapToObject,
|
|
229
|
-
scanToObject
|
|
230
|
-
};
|
|
227
|
+
class AngularFireRemoteConfigModule {
|
|
228
|
+
constructor() {
|
|
229
|
+
firebase.registerVersion('angularfire', VERSION.full, 'rc-compat');
|
|
230
|
+
}
|
|
231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireRemoteConfigModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
232
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: AngularFireRemoteConfigModule });
|
|
233
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireRemoteConfigModule, providers: [AngularFireRemoteConfig] });
|
|
234
|
+
}
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireRemoteConfigModule, decorators: [{
|
|
236
|
+
type: NgModule,
|
|
237
|
+
args: [{
|
|
238
|
+
providers: [AngularFireRemoteConfig]
|
|
239
|
+
}]
|
|
240
|
+
}], ctorParameters: () => [] });
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Generated bundle index. Do not edit.
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
export { AngularFireRemoteConfig, AngularFireRemoteConfigModule, DEFAULTS, Parameter, SETTINGS, Value, budget, filterFresh, filterRemote, mapToObject, scanToObject };
|
|
231
247
|
//# sourceMappingURL=angular-fire-compat-remote-config.mjs.map
|