@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.
Files changed (96) hide show
  1. package/esm2022/analytics/analytics.module.mjs +5 -5
  2. package/esm2022/analytics/screen-tracking.service.mjs +4 -4
  3. package/esm2022/analytics/user-tracking.service.mjs +4 -4
  4. package/esm2022/app/app.module.mjs +5 -5
  5. package/esm2022/app-check/app-check.module.mjs +5 -5
  6. package/esm2022/auth/auth.module.mjs +5 -5
  7. package/esm2022/auth-guard/auth-guard.mjs +4 -4
  8. package/esm2022/auth-guard/auth-guard.module.mjs +5 -5
  9. package/esm2022/compat/analytics/analytics.mjs +4 -4
  10. package/esm2022/compat/analytics/analytics.module.mjs +5 -5
  11. package/esm2022/compat/analytics/screen-tracking.service.mjs +4 -4
  12. package/esm2022/compat/analytics/user-tracking.service.mjs +4 -4
  13. package/esm2022/compat/auth/auth.mjs +4 -4
  14. package/esm2022/compat/auth/auth.module.mjs +5 -5
  15. package/esm2022/compat/auth-guard/auth-guard.mjs +4 -4
  16. package/esm2022/compat/auth-guard/auth-guard.module.mjs +5 -5
  17. package/esm2022/compat/database/database.mjs +4 -4
  18. package/esm2022/compat/database/database.module.mjs +5 -5
  19. package/esm2022/compat/firebase.app.module.mjs +5 -5
  20. package/esm2022/compat/firestore/firestore.mjs +4 -4
  21. package/esm2022/compat/firestore/firestore.module.mjs +5 -5
  22. package/esm2022/compat/functions/functions.mjs +4 -4
  23. package/esm2022/compat/functions/functions.module.mjs +5 -5
  24. package/esm2022/compat/messaging/messaging.mjs +4 -4
  25. package/esm2022/compat/messaging/messaging.module.mjs +5 -5
  26. package/esm2022/compat/performance/performance.mjs +4 -4
  27. package/esm2022/compat/performance/performance.module.mjs +5 -5
  28. package/esm2022/compat/performance/performance.service.mjs +4 -4
  29. package/esm2022/compat/remote-config/remote-config.mjs +4 -4
  30. package/esm2022/compat/remote-config/remote-config.module.mjs +5 -5
  31. package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +8 -8
  32. package/esm2022/compat/storage/storage.mjs +4 -4
  33. package/esm2022/compat/storage/storage.module.mjs +5 -5
  34. package/esm2022/database/database.module.mjs +5 -5
  35. package/esm2022/firestore/firestore.module.mjs +5 -5
  36. package/esm2022/firestore/lite/lite.module.mjs +5 -5
  37. package/esm2022/functions/functions.module.mjs +5 -5
  38. package/esm2022/messaging/messaging.module.mjs +5 -5
  39. package/esm2022/performance/performance.module.mjs +5 -5
  40. package/esm2022/remote-config/remote-config.module.mjs +5 -5
  41. package/esm2022/storage/storage.module.mjs +5 -5
  42. package/esm2022/vertexai-preview/vertexai.module.mjs +5 -5
  43. package/esm2022/zones.mjs +4 -4
  44. package/fesm2022/angular-fire-analytics.mjs +297 -410
  45. package/fesm2022/angular-fire-analytics.mjs.map +1 -7
  46. package/fesm2022/angular-fire-app-check.mjs +91 -162
  47. package/fesm2022/angular-fire-app-check.mjs.map +1 -7
  48. package/fesm2022/angular-fire-app.mjs +108 -181
  49. package/fesm2022/angular-fire-app.mjs.map +1 -7
  50. package/fesm2022/angular-fire-auth-guard.mjs +73 -83
  51. package/fesm2022/angular-fire-auth-guard.mjs.map +1 -7
  52. package/fesm2022/angular-fire-auth.mjs +142 -421
  53. package/fesm2022/angular-fire-auth.mjs.map +1 -7
  54. package/fesm2022/angular-fire-compat-analytics.mjs +271 -262
  55. package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -7
  56. package/fesm2022/angular-fire-compat-auth-guard.mjs +72 -83
  57. package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -7
  58. package/fesm2022/angular-fire-compat-auth.mjs +214 -215
  59. package/fesm2022/angular-fire-compat-auth.mjs.map +1 -7
  60. package/fesm2022/angular-fire-compat-database.mjs +378 -375
  61. package/fesm2022/angular-fire-compat-database.mjs.map +1 -7
  62. package/fesm2022/angular-fire-compat-firestore.mjs +677 -537
  63. package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -7
  64. package/fesm2022/angular-fire-compat-functions.mjs +94 -98
  65. package/fesm2022/angular-fire-compat-functions.mjs.map +1 -7
  66. package/fesm2022/angular-fire-compat-messaging.mjs +107 -107
  67. package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -7
  68. package/fesm2022/angular-fire-compat-performance.mjs +152 -158
  69. package/fesm2022/angular-fire-compat-performance.mjs.map +1 -7
  70. package/fesm2022/angular-fire-compat-remote-config.mjs +232 -216
  71. package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -7
  72. package/fesm2022/angular-fire-compat-storage.mjs +231 -226
  73. package/fesm2022/angular-fire-compat-storage.mjs.map +1 -7
  74. package/fesm2022/angular-fire-compat.mjs +153 -140
  75. package/fesm2022/angular-fire-compat.mjs.map +1 -7
  76. package/fesm2022/angular-fire-database.mjs +136 -376
  77. package/fesm2022/angular-fire-database.mjs.map +1 -7
  78. package/fesm2022/angular-fire-firestore-lite.mjs +139 -388
  79. package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -7
  80. package/fesm2022/angular-fire-firestore.mjs +167 -526
  81. package/fesm2022/angular-fire-firestore.mjs.map +1 -7
  82. package/fesm2022/angular-fire-functions.mjs +93 -166
  83. package/fesm2022/angular-fire-functions.mjs.map +1 -7
  84. package/fesm2022/angular-fire-messaging.mjs +118 -196
  85. package/fesm2022/angular-fire-messaging.mjs.map +1 -7
  86. package/fesm2022/angular-fire-performance.mjs +104 -178
  87. package/fesm2022/angular-fire-performance.mjs.map +1 -7
  88. package/fesm2022/angular-fire-remote-config.mjs +132 -254
  89. package/fesm2022/angular-fire-remote-config.mjs.map +1 -7
  90. package/fesm2022/angular-fire-storage.mjs +105 -225
  91. package/fesm2022/angular-fire-storage.mjs.map +1 -7
  92. package/fesm2022/angular-fire-vertexai-preview.mjs +85 -146
  93. package/fesm2022/angular-fire-vertexai-preview.mjs.map +1 -7
  94. package/fesm2022/angular-fire.mjs +213 -183
  95. package/fesm2022/angular-fire.mjs.map +1 -7
  96. package/package.json +1 -1
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/compat/firestore/observable/fromRef.ts", "../../../src/compat/firestore/document/document.ts", "../../../src/compat/firestore/collection/changes.ts", "../../../src/compat/firestore/collection/collection.ts", "../../../src/compat/firestore/collection-group/collection-group.ts", "../../../src/compat/firestore/firestore.ts", "../../../src/compat/firestore/firestore.module.ts"],
4
- "sourcesContent": ["import { Observable, SchedulerLike, asyncScheduler } from 'rxjs';\nimport { map, pairwise, startWith } from 'rxjs/operators';\nimport { Action, DocumentReference, DocumentSnapshot, Query, QuerySnapshot, Reference } from '../interfaces';\n\nfunction _fromRef<R>(ref: Reference, scheduler: SchedulerLike = asyncScheduler): Observable<R> {\n return new Observable(subscriber => {\n let unsubscribe: () => void;\n if (scheduler != null) {\n scheduler.schedule(() => {\n unsubscribe = ref.onSnapshot({ includeMetadataChanges: true }, subscriber);\n });\n } else {\n unsubscribe = ref.onSnapshot({ includeMetadataChanges: true }, subscriber);\n }\n\n return () => {\n if (unsubscribe != null) {\n unsubscribe();\n }\n };\n });\n}\n\nexport function fromRef<R, T>(ref: DocumentReference<T> | Query<T>, scheduler?: SchedulerLike) {\n return _fromRef<R>(ref, scheduler);\n}\n\nexport function fromDocRef<T>(ref: DocumentReference<T>, scheduler?: SchedulerLike): Observable<Action<DocumentSnapshot<T>>> {\n return fromRef<DocumentSnapshot<T>, T>(ref, scheduler)\n .pipe(\n startWith<DocumentSnapshot<T>, undefined>(undefined),\n pairwise(),\n map((snapshots: [DocumentSnapshot<T>, DocumentSnapshot<T>]) => {\n const [priorPayload, payload] = snapshots;\n if (!payload.exists) {\n return { payload, type: 'removed' };\n }\n if (!priorPayload?.exists) {\n return { payload, type: 'added' };\n }\n return { payload, type: 'modified' };\n })\n );\n}\n\nexport function fromCollectionRef<T>(ref: Query<T>, scheduler?: SchedulerLike): Observable<Action<QuerySnapshot<T>>> {\n return fromRef<QuerySnapshot<T>, T>(ref, scheduler).pipe(map(payload => ({ payload, type: 'query' })));\n}\n", "import { keepUnstableUntilFirst } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AngularFirestoreCollection } from '../collection/collection';\nimport { AngularFirestore, associateQuery } from '../firestore';\nimport { Action, DocumentData, DocumentReference, DocumentSnapshot, QueryFn, SetOptions } from '../interfaces';\nimport { fromDocRef } from '../observable/fromRef';\n\n/**\n * AngularFirestoreDocument service\n *\n * This class creates a reference to a Firestore Document. A reference is provided in\n * in the constructor. The class is generic which gives you type safety for data update\n * methods and data streaming.\n *\n * This class uses Symbol.observable to transform into Observable using Observable.from().\n *\n * This class is rarely used directly and should be created from the AngularFirestore service.\n *\n * Example:\n *\n * const fakeStock = new AngularFirestoreDocument<Stock>(doc('stocks/FAKE'));\n * await fakeStock.set({ name: 'FAKE', price: 0.01 });\n * fakeStock.valueChanges().map(snap => {\n * if(snap.exists) return snap.data();\n * return null;\n * }).subscribe(value => console.log(value));\n * // OR! Transform using Observable.from() and the data is unwrapped for you\n * Observable.from(fakeStock).subscribe(value => console.log(value));\n */\nexport class AngularFirestoreDocument<T = DocumentData> {\n\n /**\n * The constructor takes in a DocumentReference to provide wrapper methods\n * for data operations, data streaming, and Symbol.observable.\n */\n constructor(public ref: DocumentReference<T>, private afs: AngularFirestore) { }\n\n /**\n * Create or overwrite a single document.\n */\n set(data: T, options?: SetOptions): Promise<void> {\n return this.ref.set(data, options);\n }\n\n /**\n * Update some fields of a document without overwriting the entire document.\n */\n update(data: Partial<T>): Promise<void> {\n return this.ref.update(data);\n }\n\n /**\n * Delete a document.\n */\n delete(): Promise<void> {\n return this.ref.delete();\n }\n\n /**\n * Create a reference to a sub-collection given a path and an optional query\n * function.\n */\n collection<R = DocumentData>(path: string, queryFn?: QueryFn): AngularFirestoreCollection<R> {\n const collectionRef = this.ref.collection(path) as firebase.firestore.CollectionReference<R>;\n const { ref, query } = associateQuery(collectionRef, queryFn);\n return new AngularFirestoreCollection(ref, query, this.afs);\n }\n\n /**\n * Listen to snapshot updates from the document.\n */\n snapshotChanges(): Observable<Action<DocumentSnapshot<T>>> {\n const scheduledFromDocRef$ = fromDocRef<T>(this.ref, this.afs.schedulers.outsideAngular);\n return scheduledFromDocRef$.pipe(\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Listen to unwrapped snapshot updates from the document.\n *\n * If the `idField` option is provided, document IDs are included and mapped to the\n * provided `idField` property name.\n */\n valueChanges(options?: unknown): Observable<T | undefined>;\n valueChanges<K extends string>(options: { idField: K }): Observable<(T & { [T in K]: string }) | undefined>;\n valueChanges<K extends string>(options: { idField?: K } = {}): Observable<T | undefined> {\n return this.snapshotChanges().pipe(\n map(({ payload }) =>\n options.idField ? {\n ...payload.data(),\n ...{ [options.idField]: payload.id }\n } as T & { [T in K]: string } : payload.data()\n )\n );\n }\n\n /**\n * Retrieve the document once.\n */\n get(options?: firebase.firestore.GetOptions) {\n return from(this.ref.get(options)).pipe(\n keepUnstableUntilFirst,\n );\n }\n}\n", "import firebase from 'firebase/compat/app';\nimport { Observable, SchedulerLike } from 'rxjs';\nimport { distinctUntilChanged, map, pairwise, scan, startWith } from 'rxjs/operators';\nimport { Action, DocumentChange, DocumentChangeAction, DocumentChangeType, Query, QuerySnapshot } from '../interfaces';\nimport { fromCollectionRef } from '../observable/fromRef';\n\n\ntype ActionTupe = [Action<QuerySnapshot<firebase.firestore.DocumentData>>, Action<QuerySnapshot<firebase.firestore.DocumentData>>]\n/**\n * Return a stream of document changes on a query. These results are not in sort order but in\n * order of occurence.\n */\nexport function docChanges<T>(query: Query, scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]> {\n return fromCollectionRef(query, scheduler)\n .pipe(\n startWith<Action<QuerySnapshot<firebase.firestore.DocumentData>>, undefined>(undefined),\n pairwise(),\n map((actionTuple: ActionTupe) => {\n const [priorAction, action] = actionTuple;\n const docChanges = action.payload.docChanges();\n const actions = docChanges.map(change => ({ type: change.type, payload: change }));\n // the metadata has changed from the prior emission\n if (priorAction && JSON.stringify(priorAction.payload.metadata) !== JSON.stringify(action.payload.metadata)) {\n // go through all the docs in payload and figure out which ones changed\n action.payload.docs.forEach((currentDoc, currentIndex) => {\n const docChange = docChanges.find(d => d.doc.ref.isEqual(currentDoc.ref));\n const priorDoc = priorAction?.payload.docs.find(d => d.ref.isEqual(currentDoc.ref));\n if (docChange && JSON.stringify(docChange.doc.metadata) === JSON.stringify(currentDoc.metadata) ||\n !docChange && priorDoc && JSON.stringify(priorDoc.metadata) === JSON.stringify(currentDoc.metadata)) {\n // document doesn't appear to have changed, don't log another action\n } else {\n // since the actions are processed in order just push onto the array\n actions.push({\n type: 'modified',\n payload: {\n oldIndex: currentIndex,\n newIndex: currentIndex,\n type: 'modified',\n doc: currentDoc\n }\n });\n }\n });\n }\n return actions as DocumentChangeAction<T>[];\n }),\n );\n}\n\n/**\n * Return a stream of document changes on a query. These results are in sort order.\n */\nexport function sortedChanges<T>(\n query: Query,\n events: DocumentChangeType[],\n scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]> {\n return docChanges<T>(query, scheduler)\n .pipe(\n scan((current, changes) => combineChanges<T>(current, changes.map(it => it.payload), events), []),\n distinctUntilChanged(), // cut down on unneed change cycles\n map(changes => changes.map(c => ({ type: c.type, payload: c } as DocumentChangeAction<T>))));\n}\n\n/**\n * Combines the total result set from the current set of changes from an incoming set\n * of changes.\n */\nexport function combineChanges<T>(current: DocumentChange<T>[], changes: DocumentChange<T>[], events: DocumentChangeType[]) {\n changes.forEach(change => {\n // skip unwanted change types\n if (events.indexOf(change.type) > -1) {\n current = combineChange(current, change);\n }\n });\n return current;\n}\n\n/**\n * Splice arguments on top of a sliced array, to break top-level ===\n * this is useful for change-detection\n */\nfunction sliceAndSplice<T>(\n original: T[],\n start: number,\n deleteCount: number,\n ...args: T[]\n): T[] {\n const returnArray = original.slice();\n returnArray.splice(start, deleteCount, ...args);\n return returnArray;\n}\n\n/**\n * Creates a new sorted array from a new change.\n * Build our own because we allow filtering of action types ('added', 'removed', 'modified') before scanning\n * and so we have greater control over change detection (by breaking ===)\n */\nexport function combineChange<T>(combined: DocumentChange<T>[], change: DocumentChange<T>): DocumentChange<T>[] {\n switch (change.type) {\n case 'added':\n if (combined[change.newIndex] && combined[change.newIndex].doc.ref.isEqual(change.doc.ref)) {\n // Not sure why the duplicates are getting fired\n } else {\n return sliceAndSplice(combined, change.newIndex, 0, change);\n }\n break;\n case 'modified':\n if (combined[change.oldIndex] == null || combined[change.oldIndex].doc.ref.isEqual(change.doc.ref)) {\n // When an item changes position we first remove it\n // and then add it's new position\n if (change.oldIndex !== change.newIndex) {\n const copiedArray = combined.slice();\n copiedArray.splice(change.oldIndex, 1);\n copiedArray.splice(change.newIndex, 0, change);\n return copiedArray;\n } else {\n return sliceAndSplice(combined, change.newIndex, 1, change);\n }\n }\n break;\n case 'removed':\n if (combined[change.oldIndex] && combined[change.oldIndex].doc.ref.isEqual(change.doc.ref)) {\n return sliceAndSplice(combined, change.oldIndex, 1);\n }\n break;\n }\n return combined;\n}\n", "import { keepUnstableUntilFirst } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from } from 'rxjs';\nimport { filter, map, pairwise, scan, startWith } from 'rxjs/operators';\nimport { AngularFirestoreDocument } from '../document/document';\nimport { AngularFirestore } from '../firestore';\nimport { CollectionReference, DocumentChangeAction, DocumentChangeType, DocumentData, DocumentReference, Query } from '../interfaces';\nimport { fromCollectionRef } from '../observable/fromRef';\nimport { docChanges, sortedChanges } from './changes';\n\ntype DocumentChangeTuple<T> = [DocumentChangeAction<T>[], DocumentChangeAction<T>[]];\n\nexport function validateEventsArray(events?: DocumentChangeType[]) {\n if (!events || events.length === 0) {\n events = ['added', 'removed', 'modified'];\n }\n return events;\n}\n\n/**\n * AngularFirestoreCollection service\n *\n * This class creates a reference to a Firestore Collection. A reference and a query are provided in\n * in the constructor. The query can be the unqueried reference if no query is desired.The class\n * is generic which gives you type safety for data update methods and data streaming.\n *\n * This class uses Symbol.observable to transform into Observable using Observable.from().\n *\n * This class is rarely used directly and should be created from the AngularFirestore service.\n *\n * Example:\n *\n * const collectionRef = firebase.firestore.collection('stocks');\n * const query = collectionRef.where('price', '>', '0.01');\n * const fakeStock = new AngularFirestoreCollection<Stock>(collectionRef, query);\n *\n * // NOTE!: the updates are performed on the reference not the query\n * await fakeStock.add({ name: 'FAKE', price: 0.01 });\n *\n * // Subscribe to changes as snapshots. This provides you data updates as well as delta updates.\n * fakeStock.valueChanges().subscribe(value => console.log(value));\n */\nexport class AngularFirestoreCollection<T = DocumentData> {\n /**\n * The constructor takes in a CollectionReference and Query to provide wrapper methods\n * for data operations and data streaming.\n *\n * Note: Data operation methods are done on the reference not the query. This means\n * when you update data it is not updating data to the window of your query unless\n * the data fits the criteria of the query. See the AssociatedRefence type for details\n * on this implication.\n */\n constructor(\n public readonly ref: CollectionReference<T>,\n private readonly query: Query<T>,\n private readonly afs: AngularFirestore) { }\n\n /**\n * Listen to the latest change in the stream. This method returns changes\n * as they occur and they are not sorted by query order. This allows you to construct\n * your own data structure.\n */\n stateChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n let source = docChanges<T>(this.query, this.afs.schedulers.outsideAngular);\n if (events && events.length > 0) {\n source = source.pipe(\n map(actions => actions.filter(change => events.indexOf(change.type) > -1))\n );\n }\n return source.pipe(\n // We want to filter out empty arrays, but always emit at first, so the developer knows\n // that the collection has been resolve; even if it's empty\n startWith<DocumentChangeAction<T>[], undefined>(undefined),\n pairwise(),\n filter(([prior, current]: DocumentChangeTuple<T>) => current.length > 0 || !prior),\n map(([, current]) => current),\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Create a stream of changes as they occur it time. This method is similar to stateChanges()\n * but it collects each event in an array over time.\n */\n auditTrail(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n return this.stateChanges(events).pipe(scan((current, action) => [...current, ...action], []));\n }\n\n /**\n * Create a stream of synchronized changes. This method keeps the local array in sorted\n * query order.\n */\n snapshotChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n const validatedEvents = validateEventsArray(events);\n const scheduledSortedChanges$ = sortedChanges<T>(this.query, validatedEvents, this.afs.schedulers.outsideAngular);\n return scheduledSortedChanges$.pipe(\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Listen to all documents in the collection and its possible query as an Observable.\n *\n * If the `idField` option is provided, document IDs are included and mapped to the\n * provided `idField` property name.\n */\n valueChanges(): Observable<T[]>;\n // eslint-disable-next-line no-empty-pattern\n valueChanges({}): Observable<T[]>;\n valueChanges<K extends string>(options: {idField: K}): Observable<(T & { [T in K]: string })[]>;\n valueChanges<K extends string>(options: {idField?: K} = {}): Observable<T[]> {\n return fromCollectionRef<T>(this.query, this.afs.schedulers.outsideAngular)\n .pipe(\n map(actions => actions.payload.docs.map(a => {\n if (options.idField) {\n return {\n ...a.data() as any,\n ...{ [options.idField]: a.id }\n } as T & { [T in K]: string };\n } else {\n return a.data();\n }\n })),\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Retrieve the results of the query once.\n */\n get(options?: firebase.firestore.GetOptions) {\n return from(this.query.get(options)).pipe(\n keepUnstableUntilFirst,\n );\n }\n\n /**\n * Add data to a collection reference.\n *\n * Note: Data operation methods are done on the reference not the query. This means\n * when you update data it is not updating data to the window of your query unless\n * the data fits the criteria of the query.\n */\n add(data: T): Promise<DocumentReference<T>> {\n return this.ref.add(data);\n }\n\n /**\n * Create a reference to a single document in a collection.\n */\n doc<T2 = T>(path?: string): AngularFirestoreDocument<T2> {\n // TODO is there a better way to solve this type issue\n return new AngularFirestoreDocument(this.ref.doc(path) as any, this.afs);\n }\n}\n", "import { keepUnstableUntilFirst } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from } from 'rxjs';\nimport { filter, map, scan } from 'rxjs/operators';\nimport { docChanges, sortedChanges } from '../collection/changes';\nimport { validateEventsArray } from '../collection/collection';\nimport { AngularFirestore } from '../firestore';\nimport { DocumentChangeAction, DocumentChangeType, DocumentData, Query } from '../interfaces';\nimport { fromCollectionRef } from '../observable/fromRef';\n\n/**\n * AngularFirestoreCollectionGroup service\n *\n * This class holds a reference to a Firestore Collection Group Query.\n *\n * This class uses Symbol.observable to transform into Observable using Observable.from().\n *\n * This class is rarely used directly and should be created from the AngularFirestore service.\n *\n * Example:\n *\n * const collectionGroup = firebase.firestore.collectionGroup('stocks');\n * const query = collectionRef.where('price', '>', '0.01');\n * const fakeStock = new AngularFirestoreCollectionGroup<Stock>(query, afs);\n *\n * // Subscribe to changes as snapshots. This provides you data updates as well as delta updates.\n * fakeStock.valueChanges().subscribe(value => console.log(value));\n */\nexport class AngularFirestoreCollectionGroup<T = DocumentData> {\n /**\n * The constructor takes in a CollectionGroupQuery to provide wrapper methods\n * for data operations and data streaming.\n */\n constructor(\n private readonly query: Query<T>,\n private readonly afs: AngularFirestore) { }\n\n /**\n * Listen to the latest change in the stream. This method returns changes\n * as they occur and they are not sorted by query order. This allows you to construct\n * your own data structure.\n */\n stateChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n if (!events || events.length === 0) {\n return docChanges<T>(this.query, this.afs.schedulers.outsideAngular).pipe(\n keepUnstableUntilFirst\n );\n }\n return docChanges<T>(this.query, this.afs.schedulers.outsideAngular)\n .pipe(\n map(actions => actions.filter(change => events.indexOf(change.type) > -1)),\n filter(changes => changes.length > 0),\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Create a stream of changes as they occur it time. This method is similar to stateChanges()\n * but it collects each event in an array over time.\n */\n auditTrail(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n return this.stateChanges(events).pipe(scan((current, action) => [...current, ...action], []));\n }\n\n /**\n * Create a stream of synchronized changes. This method keeps the local array in sorted\n * query order.\n */\n snapshotChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n const validatedEvents = validateEventsArray(events);\n const scheduledSortedChanges$ = sortedChanges<T>(this.query, validatedEvents, this.afs.schedulers.outsideAngular);\n return scheduledSortedChanges$.pipe(\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Listen to all documents in the collection and its possible query as an Observable.\n *\n * If the `idField` option is provided, document IDs are included and mapped to the\n * provided `idField` property name.\n */\n valueChanges(): Observable<T[]>;\n // eslint-disable-next-line no-empty-pattern\n valueChanges({}): Observable<T[]>;\n valueChanges<K extends string>(options: {idField: K}): Observable<(T & { [T in K]: string })[]>;\n valueChanges<K extends string>(options: {idField?: K} = {}): Observable<T[]> {\n const fromCollectionRefScheduled$ = fromCollectionRef<T>(this.query, this.afs.schedulers.outsideAngular);\n return fromCollectionRefScheduled$\n .pipe(\n map(actions => actions.payload.docs.map(a => {\n if (options.idField) {\n return {\n [options.idField]: a.id,\n ...a.data()\n } as T & { [T in K]: string };\n } else {\n return a.data();\n }\n })),\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Retrieve the results of the query once.\n */\n get(options?: firebase.firestore.GetOptions) {\n return from(this.query.get(options)).pipe(\n keepUnstableUntilFirst\n );\n }\n\n}\n", "import { isPlatformServer } from '@angular/common';\nimport { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';\nimport { ɵAngularFireSchedulers } from '@angular/fire';\nimport { AppCheckInstances } from '@angular/fire/app-check';\nimport { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat';\nimport {\n SETTINGS as AUTH_SETTINGS,\n AngularFireAuth,\n LANGUAGE_CODE,\n PERSISTENCE,\n TENANT_ID,\n USE_EMULATOR as USE_AUTH_EMULATOR,\n USE_DEVICE_LANGUAGE,\n ɵauthFactory,\n} from '@angular/fire/compat/auth';\nimport { FirebaseOptions } from 'firebase/app';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from, of } from 'rxjs';\nimport { AngularFirestoreCollection } from './collection/collection';\nimport { AngularFirestoreCollectionGroup } from './collection-group/collection-group';\nimport { AngularFirestoreDocument } from './document/document';\nimport {\n AssociatedReference,\n CollectionReference,\n DocumentReference,\n PersistenceSettings,\n Query,\n QueryFn,\n QueryGroupFn,\n Settings\n} from './interfaces';\nimport 'firebase/compat/auth';\nimport 'firebase/compat/firestore';\n\n/**\n * The value of this token determines whether or not the firestore will have persistance enabled\n */\nexport const ENABLE_PERSISTENCE = new InjectionToken<boolean>('angularfire2.enableFirestorePersistence');\nexport const PERSISTENCE_SETTINGS = new InjectionToken<PersistenceSettings | undefined>('angularfire2.firestore.persistenceSettings');\nexport const SETTINGS = new InjectionToken<Settings>('angularfire2.firestore.settings');\n\ntype UseEmulatorArguments = Parameters<firebase.firestore.Firestore['useEmulator']>;\nexport const USE_EMULATOR = new InjectionToken<UseEmulatorArguments>('angularfire2.firestore.use-emulator');\n\n/**\n * A utility methods for associating a collection reference with\n * a query.\n *\n * @param collectionRef - A collection reference to query\n * @param queryFn - The callback to create a query\n *\n * Example:\n * const { query, ref } = associateQuery(docRef.collection('items'), ref => {\n * return ref.where('age', '<', 200);\n * });\n */\nexport function associateQuery<T>(collectionRef: CollectionReference<T>, queryFn = ref => ref): AssociatedReference<T> {\n const query = queryFn(collectionRef);\n const ref = collectionRef;\n return { query, ref };\n}\n\n/**\n * AngularFirestore Service\n *\n * This service is the main entry point for this feature module. It provides\n * an API for creating Collection and Reference services. These services can\n * then be used to do data updates and observable streams of the data.\n *\n * Example:\n *\n * import { Component } from '@angular/core';\n * import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument } from '@angular/fire/firestore';\n * import { Observable } from 'rxjs/Observable';\n * import { from } from 'rxjs/observable';\n *\n * @Component({\n * selector: 'app-my-component',\n * template: `\n * <h2>Items for {{ (profile | async)?.name }}\n * <ul>\n * <li *ngFor=\"let item of items | async\">{{ item.name }}</li>\n * </ul>\n * <div class=\"control-input\">\n * <input type=\"text\" #itemname />\n * <button (click)=\"addItem(itemname.value)\">Add Item</button>\n * </div>\n * `\n * })\n * export class MyComponent implements OnInit {\n *\n * // services for data operations and data streaming\n * private readonly itemsRef: AngularFirestoreCollection<Item>;\n * private readonly profileRef: AngularFirestoreDocument<Profile>;\n *\n * // observables for template\n * items: Observable<Item[]>;\n * profile: Observable<Profile>;\n *\n * // inject main service\n * constructor(private readonly afs: AngularFirestore) {}\n *\n * ngOnInit() {\n * this.itemsRef = afs.collection('items', ref => ref.where('user', '==', 'davideast').limit(10));\n * this.items = this.itemsRef.valueChanges().map(snap => snap.docs.map(data => doc.data()));\n * // this.items = from(this.itemsRef); // you can also do this with no mapping\n *\n * this.profileRef = afs.doc('users/davideast');\n * this.profile = this.profileRef.valueChanges();\n * }\n *\n * addItem(name: string) {\n * const user = 'davideast';\n * this.itemsRef.add({ name, user });\n * }\n * }\n */\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFirestore {\n public readonly firestore: firebase.firestore.Firestore;\n public readonly persistenceEnabled$: Observable<boolean>;\n\n /**\n * Each Feature of AngularFire has a FirebaseApp injected. This way we\n * don't rely on the main Firebase App instance and we can create named\n * apps and use multiple apps.\n */\n constructor(\n @Inject(FIREBASE_OPTIONS) options: FirebaseOptions,\n @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined,\n @Optional() @Inject(ENABLE_PERSISTENCE) shouldEnablePersistence: boolean | null,\n @Optional() @Inject(SETTINGS) settings: Settings | null,\n // eslint-disable-next-line @typescript-eslint/ban-types\n @Inject(PLATFORM_ID) platformId: Object,\n zone: NgZone,\n public schedulers: ɵAngularFireSchedulers,\n @Optional() @Inject(PERSISTENCE_SETTINGS) persistenceSettings: PersistenceSettings | null,\n @Optional() @Inject(USE_EMULATOR) _useEmulator: any,\n @Optional() auth: AngularFireAuth,\n @Optional() @Inject(USE_AUTH_EMULATOR) useAuthEmulator: any,\n @Optional() @Inject(AUTH_SETTINGS) authSettings: any, // can't use firebase.auth.AuthSettings here\n @Optional() @Inject(TENANT_ID) tenantId: string | null,\n @Optional() @Inject(LANGUAGE_CODE) languageCode: string | null,\n @Optional() @Inject(USE_DEVICE_LANGUAGE) useDeviceLanguage: boolean | null,\n @Optional() @Inject(PERSISTENCE) persistence: string | null,\n @Optional() _appCheckInstances: AppCheckInstances,\n ) {\n const app = ɵfirebaseAppFactory(options, zone, name);\n const useEmulator: UseEmulatorArguments | null = _useEmulator;\n\n if (auth) {\n ɵauthFactory(app, zone, useAuthEmulator, tenantId, languageCode, useDeviceLanguage, authSettings, persistence);\n }\n\n [this.firestore, this.persistenceEnabled$] = ɵcacheInstance(`${app.name}.firestore`, 'AngularFirestore', app.name, () => {\n const firestore = zone.runOutsideAngular(() => app.firestore());\n if (settings) {\n firestore.settings(settings);\n }\n if (useEmulator) {\n firestore.useEmulator(...useEmulator);\n }\n\n if (shouldEnablePersistence && !isPlatformServer(platformId)) {\n // We need to try/catch here because not all enablePersistence() failures are caught\n // https://github.com/firebase/firebase-js-sdk/issues/608\n const enablePersistence = () => {\n try {\n return from(firestore.enablePersistence(persistenceSettings || undefined).then(() => true, () => false));\n } catch (e) {\n if (typeof console !== 'undefined') { console.warn(e); }\n return of(false);\n }\n };\n return [firestore, zone.runOutsideAngular(enablePersistence)];\n } else {\n return [firestore, of(false)];\n }\n\n }, [settings, useEmulator, shouldEnablePersistence]);\n }\n\n /**\n * Create a reference to a Firestore Collection based on a path or\n * CollectionReference and an optional query function to narrow the result\n * set.\n */\n collection<T>(path: string, queryFn?: QueryFn): AngularFirestoreCollection<T>;\n collection<T>(ref: CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection<T>;\n collection<T>(pathOrRef: string | CollectionReference<T>, queryFn?: QueryFn): AngularFirestoreCollection<T> {\n let collectionRef: CollectionReference<T>;\n if (typeof pathOrRef === 'string') {\n collectionRef = this.firestore.collection(pathOrRef) as firebase.firestore.CollectionReference<T>;\n } else {\n collectionRef = pathOrRef;\n }\n const { ref, query } = associateQuery<T>(collectionRef, queryFn);\n const refInZone = this.schedulers.ngZone.run(() => ref);\n return new AngularFirestoreCollection<T>(refInZone, query, this);\n }\n\n /**\n * Create a reference to a Firestore Collection Group based on a collectionId\n * and an optional query function to narrow the result\n * set.\n */\n collectionGroup<T>(collectionId: string, queryGroupFn?: QueryGroupFn<T>): AngularFirestoreCollectionGroup<T> {\n const queryFn = queryGroupFn || (ref => ref);\n const collectionGroup: Query<T> = this.firestore.collectionGroup(collectionId) as firebase.firestore.Query<T>;\n return new AngularFirestoreCollectionGroup<T>(queryFn(collectionGroup), this);\n }\n\n /**\n * Create a reference to a Firestore Document based on a path or\n * DocumentReference. Note that documents are not queryable because they are\n * simply objects. However, documents have sub-collections that return a\n * Collection reference and can be queried.\n */\n doc<T>(path: string): AngularFirestoreDocument<T>;\n doc<T>(ref: DocumentReference): AngularFirestoreDocument<T>;\n doc<T>(pathOrRef: string | DocumentReference<T>): AngularFirestoreDocument<T> {\n let ref: DocumentReference<T>;\n if (typeof pathOrRef === 'string') {\n ref = this.firestore.doc(pathOrRef) as firebase.firestore.DocumentReference<T>;\n } else {\n ref = pathOrRef;\n }\n const refInZone = this.schedulers.ngZone.run(() => ref);\n return new AngularFirestoreDocument<T>(refInZone, this);\n }\n\n /**\n * Returns a generated Firestore Document Id.\n */\n createId() {\n return this.firestore.collection('_').doc().id;\n }\n}\n", "import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFirestore, ENABLE_PERSISTENCE, PERSISTENCE_SETTINGS } from './firestore';\nimport { PersistenceSettings } from './interfaces';\n\n@NgModule({\n providers: [ AngularFirestore ]\n})\nexport class AngularFirestoreModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'fst-compat');\n }\n /**\n * Attempt to enable persistent storage, if possible\n */\n static enablePersistence(persistenceSettings?: PersistenceSettings): ModuleWithProviders<AngularFirestoreModule> {\n return {\n ngModule: AngularFirestoreModule,\n providers: [\n { provide: ENABLE_PERSISTENCE, useValue: true },\n { provide: PERSISTENCE_SETTINGS, useValue: persistenceSettings },\n ]\n };\n }\n}\n"],
5
- "mappings": ";AAAA,SA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tC;;QAAY;SAAO,WAAW;;QAC9B;;;;ACnJL,SAA8B,gBAAgB;AAC9C,SAAS,eAAe;AACxB,OAAO,cAAc;;AAOf,IAAO,yBAAP,MAAO,wBAAsB;EACjC,cAAA;AACE,aAAS,gBAAgB,eAAe,QAAQ,MAAM,YAAY;EACpE;;;;EAIA,OAAO,kBAAkB,qBAAyC;AAChE,WAAO;MACL,UAAU;MACV,WAAW;QACT,EAAE,SAAS,oBAAoB,UAAU,KAAI;QAC7C,EAAE,SAAS,sBAAsB,UAAU,oBAAmB;;;EAGpE;4GAfW,yBAAsB,MAAA,CAAA,GAAA,QAAA,oBAAA,SAAA,CAAA;6GAAtB,wBAAsB,CAAA;6GAAtB,yBAAsB,WAFtB,CAAE,gBAAgB,EAAE,CAAA;;kGAEpB,wBAAsB,YAAA,CAAA;QAHlC;SAAS;IACR,WAAW,CAAE,gBAAgB;GAC9B;;",
6
- "names": ["map", "map", "pairwise", "startWith", "docChanges", "keepUnstableUntilFirst", "from", "map", "pairwise", "scan", "startWith", "keepUnstableUntilFirst", "from", "filter", "map", "scan", "from"]
7
- }
1
+ {"version":3,"file":"angular-fire-compat-firestore.mjs","sources":["../../../src/compat/firestore/observable/fromRef.ts","../../../src/compat/firestore/document/document.ts","../../../src/compat/firestore/collection/changes.ts","../../../src/compat/firestore/collection/collection.ts","../../../src/compat/firestore/collection-group/collection-group.ts","../../../src/compat/firestore/firestore.ts","../../../src/compat/firestore/firestore.module.ts","../../../src/compat/firestore/angular-fire-compat-firestore.ts"],"sourcesContent":["import { Observable, SchedulerLike, asyncScheduler } from 'rxjs';\nimport { map, pairwise, startWith } from 'rxjs/operators';\nimport { Action, DocumentReference, DocumentSnapshot, Query, QuerySnapshot, Reference } from '../interfaces';\n\nfunction _fromRef<R>(ref: Reference, scheduler: SchedulerLike = asyncScheduler): Observable<R> {\n return new Observable(subscriber => {\n let unsubscribe: () => void;\n if (scheduler != null) {\n scheduler.schedule(() => {\n unsubscribe = ref.onSnapshot({ includeMetadataChanges: true }, subscriber);\n });\n } else {\n unsubscribe = ref.onSnapshot({ includeMetadataChanges: true }, subscriber);\n }\n\n return () => {\n if (unsubscribe != null) {\n unsubscribe();\n }\n };\n });\n}\n\nexport function fromRef<R, T>(ref: DocumentReference<T> | Query<T>, scheduler?: SchedulerLike) {\n return _fromRef<R>(ref, scheduler);\n}\n\nexport function fromDocRef<T>(ref: DocumentReference<T>, scheduler?: SchedulerLike): Observable<Action<DocumentSnapshot<T>>> {\n return fromRef<DocumentSnapshot<T>, T>(ref, scheduler)\n .pipe(\n startWith<DocumentSnapshot<T>, undefined>(undefined),\n pairwise(),\n map((snapshots: [DocumentSnapshot<T>, DocumentSnapshot<T>]) => {\n const [priorPayload, payload] = snapshots;\n if (!payload.exists) {\n return { payload, type: 'removed' };\n }\n if (!priorPayload?.exists) {\n return { payload, type: 'added' };\n }\n return { payload, type: 'modified' };\n })\n );\n}\n\nexport function fromCollectionRef<T>(ref: Query<T>, scheduler?: SchedulerLike): Observable<Action<QuerySnapshot<T>>> {\n return fromRef<QuerySnapshot<T>, T>(ref, scheduler).pipe(map(payload => ({ payload, type: 'query' })));\n}\n","import { keepUnstableUntilFirst } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AngularFirestoreCollection } from '../collection/collection';\nimport { AngularFirestore, associateQuery } from '../firestore';\nimport { Action, DocumentData, DocumentReference, DocumentSnapshot, QueryFn, SetOptions } from '../interfaces';\nimport { fromDocRef } from '../observable/fromRef';\n\n/**\n * AngularFirestoreDocument service\n *\n * This class creates a reference to a Firestore Document. A reference is provided in\n * in the constructor. The class is generic which gives you type safety for data update\n * methods and data streaming.\n *\n * This class uses Symbol.observable to transform into Observable using Observable.from().\n *\n * This class is rarely used directly and should be created from the AngularFirestore service.\n *\n * Example:\n *\n * const fakeStock = new AngularFirestoreDocument<Stock>(doc('stocks/FAKE'));\n * await fakeStock.set({ name: 'FAKE', price: 0.01 });\n * fakeStock.valueChanges().map(snap => {\n * if(snap.exists) return snap.data();\n * return null;\n * }).subscribe(value => console.log(value));\n * // OR! Transform using Observable.from() and the data is unwrapped for you\n * Observable.from(fakeStock).subscribe(value => console.log(value));\n */\nexport class AngularFirestoreDocument<T = DocumentData> {\n\n /**\n * The constructor takes in a DocumentReference to provide wrapper methods\n * for data operations, data streaming, and Symbol.observable.\n */\n constructor(public ref: DocumentReference<T>, private afs: AngularFirestore) { }\n\n /**\n * Create or overwrite a single document.\n */\n set(data: T, options?: SetOptions): Promise<void> {\n return this.ref.set(data, options);\n }\n\n /**\n * Update some fields of a document without overwriting the entire document.\n */\n update(data: Partial<T>): Promise<void> {\n return this.ref.update(data);\n }\n\n /**\n * Delete a document.\n */\n delete(): Promise<void> {\n return this.ref.delete();\n }\n\n /**\n * Create a reference to a sub-collection given a path and an optional query\n * function.\n */\n collection<R = DocumentData>(path: string, queryFn?: QueryFn): AngularFirestoreCollection<R> {\n const collectionRef = this.ref.collection(path) as firebase.firestore.CollectionReference<R>;\n const { ref, query } = associateQuery(collectionRef, queryFn);\n return new AngularFirestoreCollection(ref, query, this.afs);\n }\n\n /**\n * Listen to snapshot updates from the document.\n */\n snapshotChanges(): Observable<Action<DocumentSnapshot<T>>> {\n const scheduledFromDocRef$ = fromDocRef<T>(this.ref, this.afs.schedulers.outsideAngular);\n return scheduledFromDocRef$.pipe(\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Listen to unwrapped snapshot updates from the document.\n *\n * If the `idField` option is provided, document IDs are included and mapped to the\n * provided `idField` property name.\n */\n valueChanges(options?: unknown): Observable<T | undefined>;\n valueChanges<K extends string>(options: { idField: K }): Observable<(T & { [T in K]: string }) | undefined>;\n valueChanges<K extends string>(options: { idField?: K } = {}): Observable<T | undefined> {\n return this.snapshotChanges().pipe(\n map(({ payload }) =>\n options.idField ? {\n ...payload.data(),\n ...{ [options.idField]: payload.id }\n } as T & { [T in K]: string } : payload.data()\n )\n );\n }\n\n /**\n * Retrieve the document once.\n */\n get(options?: firebase.firestore.GetOptions) {\n return from(this.ref.get(options)).pipe(\n keepUnstableUntilFirst,\n );\n }\n}\n","import firebase from 'firebase/compat/app';\nimport { Observable, SchedulerLike } from 'rxjs';\nimport { distinctUntilChanged, map, pairwise, scan, startWith } from 'rxjs/operators';\nimport { Action, DocumentChange, DocumentChangeAction, DocumentChangeType, Query, QuerySnapshot } from '../interfaces';\nimport { fromCollectionRef } from '../observable/fromRef';\n\n\ntype ActionTupe = [Action<QuerySnapshot<firebase.firestore.DocumentData>>, Action<QuerySnapshot<firebase.firestore.DocumentData>>]\n/**\n * Return a stream of document changes on a query. These results are not in sort order but in\n * order of occurence.\n */\nexport function docChanges<T>(query: Query, scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]> {\n return fromCollectionRef(query, scheduler)\n .pipe(\n startWith<Action<QuerySnapshot<firebase.firestore.DocumentData>>, undefined>(undefined),\n pairwise(),\n map((actionTuple: ActionTupe) => {\n const [priorAction, action] = actionTuple;\n const docChanges = action.payload.docChanges();\n const actions = docChanges.map(change => ({ type: change.type, payload: change }));\n // the metadata has changed from the prior emission\n if (priorAction && JSON.stringify(priorAction.payload.metadata) !== JSON.stringify(action.payload.metadata)) {\n // go through all the docs in payload and figure out which ones changed\n action.payload.docs.forEach((currentDoc, currentIndex) => {\n const docChange = docChanges.find(d => d.doc.ref.isEqual(currentDoc.ref));\n const priorDoc = priorAction?.payload.docs.find(d => d.ref.isEqual(currentDoc.ref));\n if (docChange && JSON.stringify(docChange.doc.metadata) === JSON.stringify(currentDoc.metadata) ||\n !docChange && priorDoc && JSON.stringify(priorDoc.metadata) === JSON.stringify(currentDoc.metadata)) {\n // document doesn't appear to have changed, don't log another action\n } else {\n // since the actions are processed in order just push onto the array\n actions.push({\n type: 'modified',\n payload: {\n oldIndex: currentIndex,\n newIndex: currentIndex,\n type: 'modified',\n doc: currentDoc\n }\n });\n }\n });\n }\n return actions as DocumentChangeAction<T>[];\n }),\n );\n}\n\n/**\n * Return a stream of document changes on a query. These results are in sort order.\n */\nexport function sortedChanges<T>(\n query: Query,\n events: DocumentChangeType[],\n scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]> {\n return docChanges<T>(query, scheduler)\n .pipe(\n scan((current, changes) => combineChanges<T>(current, changes.map(it => it.payload), events), []),\n distinctUntilChanged(), // cut down on unneed change cycles\n map(changes => changes.map(c => ({ type: c.type, payload: c } as DocumentChangeAction<T>))));\n}\n\n/**\n * Combines the total result set from the current set of changes from an incoming set\n * of changes.\n */\nexport function combineChanges<T>(current: DocumentChange<T>[], changes: DocumentChange<T>[], events: DocumentChangeType[]) {\n changes.forEach(change => {\n // skip unwanted change types\n if (events.indexOf(change.type) > -1) {\n current = combineChange(current, change);\n }\n });\n return current;\n}\n\n/**\n * Splice arguments on top of a sliced array, to break top-level ===\n * this is useful for change-detection\n */\nfunction sliceAndSplice<T>(\n original: T[],\n start: number,\n deleteCount: number,\n ...args: T[]\n): T[] {\n const returnArray = original.slice();\n returnArray.splice(start, deleteCount, ...args);\n return returnArray;\n}\n\n/**\n * Creates a new sorted array from a new change.\n * Build our own because we allow filtering of action types ('added', 'removed', 'modified') before scanning\n * and so we have greater control over change detection (by breaking ===)\n */\nexport function combineChange<T>(combined: DocumentChange<T>[], change: DocumentChange<T>): DocumentChange<T>[] {\n switch (change.type) {\n case 'added':\n if (combined[change.newIndex] && combined[change.newIndex].doc.ref.isEqual(change.doc.ref)) {\n // Not sure why the duplicates are getting fired\n } else {\n return sliceAndSplice(combined, change.newIndex, 0, change);\n }\n break;\n case 'modified':\n if (combined[change.oldIndex] == null || combined[change.oldIndex].doc.ref.isEqual(change.doc.ref)) {\n // When an item changes position we first remove it\n // and then add it's new position\n if (change.oldIndex !== change.newIndex) {\n const copiedArray = combined.slice();\n copiedArray.splice(change.oldIndex, 1);\n copiedArray.splice(change.newIndex, 0, change);\n return copiedArray;\n } else {\n return sliceAndSplice(combined, change.newIndex, 1, change);\n }\n }\n break;\n case 'removed':\n if (combined[change.oldIndex] && combined[change.oldIndex].doc.ref.isEqual(change.doc.ref)) {\n return sliceAndSplice(combined, change.oldIndex, 1);\n }\n break;\n }\n return combined;\n}\n","import { keepUnstableUntilFirst } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from } from 'rxjs';\nimport { filter, map, pairwise, scan, startWith } from 'rxjs/operators';\nimport { AngularFirestoreDocument } from '../document/document';\nimport { AngularFirestore } from '../firestore';\nimport { CollectionReference, DocumentChangeAction, DocumentChangeType, DocumentData, DocumentReference, Query } from '../interfaces';\nimport { fromCollectionRef } from '../observable/fromRef';\nimport { docChanges, sortedChanges } from './changes';\n\ntype DocumentChangeTuple<T> = [DocumentChangeAction<T>[], DocumentChangeAction<T>[]];\n\nexport function validateEventsArray(events?: DocumentChangeType[]) {\n if (!events || events.length === 0) {\n events = ['added', 'removed', 'modified'];\n }\n return events;\n}\n\n/**\n * AngularFirestoreCollection service\n *\n * This class creates a reference to a Firestore Collection. A reference and a query are provided in\n * in the constructor. The query can be the unqueried reference if no query is desired.The class\n * is generic which gives you type safety for data update methods and data streaming.\n *\n * This class uses Symbol.observable to transform into Observable using Observable.from().\n *\n * This class is rarely used directly and should be created from the AngularFirestore service.\n *\n * Example:\n *\n * const collectionRef = firebase.firestore.collection('stocks');\n * const query = collectionRef.where('price', '>', '0.01');\n * const fakeStock = new AngularFirestoreCollection<Stock>(collectionRef, query);\n *\n * // NOTE!: the updates are performed on the reference not the query\n * await fakeStock.add({ name: 'FAKE', price: 0.01 });\n *\n * // Subscribe to changes as snapshots. This provides you data updates as well as delta updates.\n * fakeStock.valueChanges().subscribe(value => console.log(value));\n */\nexport class AngularFirestoreCollection<T = DocumentData> {\n /**\n * The constructor takes in a CollectionReference and Query to provide wrapper methods\n * for data operations and data streaming.\n *\n * Note: Data operation methods are done on the reference not the query. This means\n * when you update data it is not updating data to the window of your query unless\n * the data fits the criteria of the query. See the AssociatedRefence type for details\n * on this implication.\n */\n constructor(\n public readonly ref: CollectionReference<T>,\n private readonly query: Query<T>,\n private readonly afs: AngularFirestore) { }\n\n /**\n * Listen to the latest change in the stream. This method returns changes\n * as they occur and they are not sorted by query order. This allows you to construct\n * your own data structure.\n */\n stateChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n let source = docChanges<T>(this.query, this.afs.schedulers.outsideAngular);\n if (events && events.length > 0) {\n source = source.pipe(\n map(actions => actions.filter(change => events.indexOf(change.type) > -1))\n );\n }\n return source.pipe(\n // We want to filter out empty arrays, but always emit at first, so the developer knows\n // that the collection has been resolve; even if it's empty\n startWith<DocumentChangeAction<T>[], undefined>(undefined),\n pairwise(),\n filter(([prior, current]: DocumentChangeTuple<T>) => current.length > 0 || !prior),\n map(([, current]) => current),\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Create a stream of changes as they occur it time. This method is similar to stateChanges()\n * but it collects each event in an array over time.\n */\n auditTrail(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n return this.stateChanges(events).pipe(scan((current, action) => [...current, ...action], []));\n }\n\n /**\n * Create a stream of synchronized changes. This method keeps the local array in sorted\n * query order.\n */\n snapshotChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n const validatedEvents = validateEventsArray(events);\n const scheduledSortedChanges$ = sortedChanges<T>(this.query, validatedEvents, this.afs.schedulers.outsideAngular);\n return scheduledSortedChanges$.pipe(\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Listen to all documents in the collection and its possible query as an Observable.\n *\n * If the `idField` option is provided, document IDs are included and mapped to the\n * provided `idField` property name.\n */\n valueChanges(): Observable<T[]>;\n // eslint-disable-next-line no-empty-pattern\n valueChanges({}): Observable<T[]>;\n valueChanges<K extends string>(options: {idField: K}): Observable<(T & { [T in K]: string })[]>;\n valueChanges<K extends string>(options: {idField?: K} = {}): Observable<T[]> {\n return fromCollectionRef<T>(this.query, this.afs.schedulers.outsideAngular)\n .pipe(\n map(actions => actions.payload.docs.map(a => {\n if (options.idField) {\n return {\n ...a.data() as any,\n ...{ [options.idField]: a.id }\n } as T & { [T in K]: string };\n } else {\n return a.data();\n }\n })),\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Retrieve the results of the query once.\n */\n get(options?: firebase.firestore.GetOptions) {\n return from(this.query.get(options)).pipe(\n keepUnstableUntilFirst,\n );\n }\n\n /**\n * Add data to a collection reference.\n *\n * Note: Data operation methods are done on the reference not the query. This means\n * when you update data it is not updating data to the window of your query unless\n * the data fits the criteria of the query.\n */\n add(data: T): Promise<DocumentReference<T>> {\n return this.ref.add(data);\n }\n\n /**\n * Create a reference to a single document in a collection.\n */\n doc<T2 = T>(path?: string): AngularFirestoreDocument<T2> {\n // TODO is there a better way to solve this type issue\n return new AngularFirestoreDocument(this.ref.doc(path) as any, this.afs);\n }\n}\n","import { keepUnstableUntilFirst } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from } from 'rxjs';\nimport { filter, map, scan } from 'rxjs/operators';\nimport { docChanges, sortedChanges } from '../collection/changes';\nimport { validateEventsArray } from '../collection/collection';\nimport { AngularFirestore } from '../firestore';\nimport { DocumentChangeAction, DocumentChangeType, DocumentData, Query } from '../interfaces';\nimport { fromCollectionRef } from '../observable/fromRef';\n\n/**\n * AngularFirestoreCollectionGroup service\n *\n * This class holds a reference to a Firestore Collection Group Query.\n *\n * This class uses Symbol.observable to transform into Observable using Observable.from().\n *\n * This class is rarely used directly and should be created from the AngularFirestore service.\n *\n * Example:\n *\n * const collectionGroup = firebase.firestore.collectionGroup('stocks');\n * const query = collectionRef.where('price', '>', '0.01');\n * const fakeStock = new AngularFirestoreCollectionGroup<Stock>(query, afs);\n *\n * // Subscribe to changes as snapshots. This provides you data updates as well as delta updates.\n * fakeStock.valueChanges().subscribe(value => console.log(value));\n */\nexport class AngularFirestoreCollectionGroup<T = DocumentData> {\n /**\n * The constructor takes in a CollectionGroupQuery to provide wrapper methods\n * for data operations and data streaming.\n */\n constructor(\n private readonly query: Query<T>,\n private readonly afs: AngularFirestore) { }\n\n /**\n * Listen to the latest change in the stream. This method returns changes\n * as they occur and they are not sorted by query order. This allows you to construct\n * your own data structure.\n */\n stateChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n if (!events || events.length === 0) {\n return docChanges<T>(this.query, this.afs.schedulers.outsideAngular).pipe(\n keepUnstableUntilFirst\n );\n }\n return docChanges<T>(this.query, this.afs.schedulers.outsideAngular)\n .pipe(\n map(actions => actions.filter(change => events.indexOf(change.type) > -1)),\n filter(changes => changes.length > 0),\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Create a stream of changes as they occur it time. This method is similar to stateChanges()\n * but it collects each event in an array over time.\n */\n auditTrail(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n return this.stateChanges(events).pipe(scan((current, action) => [...current, ...action], []));\n }\n\n /**\n * Create a stream of synchronized changes. This method keeps the local array in sorted\n * query order.\n */\n snapshotChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]> {\n const validatedEvents = validateEventsArray(events);\n const scheduledSortedChanges$ = sortedChanges<T>(this.query, validatedEvents, this.afs.schedulers.outsideAngular);\n return scheduledSortedChanges$.pipe(\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Listen to all documents in the collection and its possible query as an Observable.\n *\n * If the `idField` option is provided, document IDs are included and mapped to the\n * provided `idField` property name.\n */\n valueChanges(): Observable<T[]>;\n // eslint-disable-next-line no-empty-pattern\n valueChanges({}): Observable<T[]>;\n valueChanges<K extends string>(options: {idField: K}): Observable<(T & { [T in K]: string })[]>;\n valueChanges<K extends string>(options: {idField?: K} = {}): Observable<T[]> {\n const fromCollectionRefScheduled$ = fromCollectionRef<T>(this.query, this.afs.schedulers.outsideAngular);\n return fromCollectionRefScheduled$\n .pipe(\n map(actions => actions.payload.docs.map(a => {\n if (options.idField) {\n return {\n [options.idField]: a.id,\n ...a.data()\n } as T & { [T in K]: string };\n } else {\n return a.data();\n }\n })),\n keepUnstableUntilFirst\n );\n }\n\n /**\n * Retrieve the results of the query once.\n */\n get(options?: firebase.firestore.GetOptions) {\n return from(this.query.get(options)).pipe(\n keepUnstableUntilFirst\n );\n }\n\n}\n","import { isPlatformServer } from '@angular/common';\nimport { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';\nimport { ɵAngularFireSchedulers } from '@angular/fire';\nimport { AppCheckInstances } from '@angular/fire/app-check';\nimport { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat';\nimport {\n SETTINGS as AUTH_SETTINGS,\n AngularFireAuth,\n LANGUAGE_CODE,\n PERSISTENCE,\n TENANT_ID,\n USE_EMULATOR as USE_AUTH_EMULATOR,\n USE_DEVICE_LANGUAGE,\n ɵauthFactory,\n} from '@angular/fire/compat/auth';\nimport { FirebaseOptions } from 'firebase/app';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from, of } from 'rxjs';\nimport { AngularFirestoreCollection } from './collection/collection';\nimport { AngularFirestoreCollectionGroup } from './collection-group/collection-group';\nimport { AngularFirestoreDocument } from './document/document';\nimport {\n AssociatedReference,\n CollectionReference,\n DocumentReference,\n PersistenceSettings,\n Query,\n QueryFn,\n QueryGroupFn,\n Settings\n} from './interfaces';\nimport 'firebase/compat/auth';\nimport 'firebase/compat/firestore';\n\n/**\n * The value of this token determines whether or not the firestore will have persistance enabled\n */\nexport const ENABLE_PERSISTENCE = new InjectionToken<boolean>('angularfire2.enableFirestorePersistence');\nexport const PERSISTENCE_SETTINGS = new InjectionToken<PersistenceSettings | undefined>('angularfire2.firestore.persistenceSettings');\nexport const SETTINGS = new InjectionToken<Settings>('angularfire2.firestore.settings');\n\ntype UseEmulatorArguments = Parameters<firebase.firestore.Firestore['useEmulator']>;\nexport const USE_EMULATOR = new InjectionToken<UseEmulatorArguments>('angularfire2.firestore.use-emulator');\n\n/**\n * A utility methods for associating a collection reference with\n * a query.\n *\n * @param collectionRef - A collection reference to query\n * @param queryFn - The callback to create a query\n *\n * Example:\n * const { query, ref } = associateQuery(docRef.collection('items'), ref => {\n * return ref.where('age', '<', 200);\n * });\n */\nexport function associateQuery<T>(collectionRef: CollectionReference<T>, queryFn = ref => ref): AssociatedReference<T> {\n const query = queryFn(collectionRef);\n const ref = collectionRef;\n return { query, ref };\n}\n\n/**\n * AngularFirestore Service\n *\n * This service is the main entry point for this feature module. It provides\n * an API for creating Collection and Reference services. These services can\n * then be used to do data updates and observable streams of the data.\n *\n * Example:\n *\n * import { Component } from '@angular/core';\n * import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument } from '@angular/fire/firestore';\n * import { Observable } from 'rxjs/Observable';\n * import { from } from 'rxjs/observable';\n *\n * @Component({\n * selector: 'app-my-component',\n * template: `\n * <h2>Items for {{ (profile | async)?.name }}\n * <ul>\n * <li *ngFor=\"let item of items | async\">{{ item.name }}</li>\n * </ul>\n * <div class=\"control-input\">\n * <input type=\"text\" #itemname />\n * <button (click)=\"addItem(itemname.value)\">Add Item</button>\n * </div>\n * `\n * })\n * export class MyComponent implements OnInit {\n *\n * // services for data operations and data streaming\n * private readonly itemsRef: AngularFirestoreCollection<Item>;\n * private readonly profileRef: AngularFirestoreDocument<Profile>;\n *\n * // observables for template\n * items: Observable<Item[]>;\n * profile: Observable<Profile>;\n *\n * // inject main service\n * constructor(private readonly afs: AngularFirestore) {}\n *\n * ngOnInit() {\n * this.itemsRef = afs.collection('items', ref => ref.where('user', '==', 'davideast').limit(10));\n * this.items = this.itemsRef.valueChanges().map(snap => snap.docs.map(data => doc.data()));\n * // this.items = from(this.itemsRef); // you can also do this with no mapping\n *\n * this.profileRef = afs.doc('users/davideast');\n * this.profile = this.profileRef.valueChanges();\n * }\n *\n * addItem(name: string) {\n * const user = 'davideast';\n * this.itemsRef.add({ name, user });\n * }\n * }\n */\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFirestore {\n public readonly firestore: firebase.firestore.Firestore;\n public readonly persistenceEnabled$: Observable<boolean>;\n\n /**\n * Each Feature of AngularFire has a FirebaseApp injected. This way we\n * don't rely on the main Firebase App instance and we can create named\n * apps and use multiple apps.\n */\n constructor(\n @Inject(FIREBASE_OPTIONS) options: FirebaseOptions,\n @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined,\n @Optional() @Inject(ENABLE_PERSISTENCE) shouldEnablePersistence: boolean | null,\n @Optional() @Inject(SETTINGS) settings: Settings | null,\n // eslint-disable-next-line @typescript-eslint/ban-types\n @Inject(PLATFORM_ID) platformId: Object,\n zone: NgZone,\n public schedulers: ɵAngularFireSchedulers,\n @Optional() @Inject(PERSISTENCE_SETTINGS) persistenceSettings: PersistenceSettings | null,\n @Optional() @Inject(USE_EMULATOR) _useEmulator: any,\n @Optional() auth: AngularFireAuth,\n @Optional() @Inject(USE_AUTH_EMULATOR) useAuthEmulator: any,\n @Optional() @Inject(AUTH_SETTINGS) authSettings: any, // can't use firebase.auth.AuthSettings here\n @Optional() @Inject(TENANT_ID) tenantId: string | null,\n @Optional() @Inject(LANGUAGE_CODE) languageCode: string | null,\n @Optional() @Inject(USE_DEVICE_LANGUAGE) useDeviceLanguage: boolean | null,\n @Optional() @Inject(PERSISTENCE) persistence: string | null,\n @Optional() _appCheckInstances: AppCheckInstances,\n ) {\n const app = ɵfirebaseAppFactory(options, zone, name);\n const useEmulator: UseEmulatorArguments | null = _useEmulator;\n\n if (auth) {\n ɵauthFactory(app, zone, useAuthEmulator, tenantId, languageCode, useDeviceLanguage, authSettings, persistence);\n }\n\n [this.firestore, this.persistenceEnabled$] = ɵcacheInstance(`${app.name}.firestore`, 'AngularFirestore', app.name, () => {\n const firestore = zone.runOutsideAngular(() => app.firestore());\n if (settings) {\n firestore.settings(settings);\n }\n if (useEmulator) {\n firestore.useEmulator(...useEmulator);\n }\n\n if (shouldEnablePersistence && !isPlatformServer(platformId)) {\n // We need to try/catch here because not all enablePersistence() failures are caught\n // https://github.com/firebase/firebase-js-sdk/issues/608\n const enablePersistence = () => {\n try {\n return from(firestore.enablePersistence(persistenceSettings || undefined).then(() => true, () => false));\n } catch (e) {\n if (typeof console !== 'undefined') { console.warn(e); }\n return of(false);\n }\n };\n return [firestore, zone.runOutsideAngular(enablePersistence)];\n } else {\n return [firestore, of(false)];\n }\n\n }, [settings, useEmulator, shouldEnablePersistence]);\n }\n\n /**\n * Create a reference to a Firestore Collection based on a path or\n * CollectionReference and an optional query function to narrow the result\n * set.\n */\n collection<T>(path: string, queryFn?: QueryFn): AngularFirestoreCollection<T>;\n collection<T>(ref: CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection<T>;\n collection<T>(pathOrRef: string | CollectionReference<T>, queryFn?: QueryFn): AngularFirestoreCollection<T> {\n let collectionRef: CollectionReference<T>;\n if (typeof pathOrRef === 'string') {\n collectionRef = this.firestore.collection(pathOrRef) as firebase.firestore.CollectionReference<T>;\n } else {\n collectionRef = pathOrRef;\n }\n const { ref, query } = associateQuery<T>(collectionRef, queryFn);\n const refInZone = this.schedulers.ngZone.run(() => ref);\n return new AngularFirestoreCollection<T>(refInZone, query, this);\n }\n\n /**\n * Create a reference to a Firestore Collection Group based on a collectionId\n * and an optional query function to narrow the result\n * set.\n */\n collectionGroup<T>(collectionId: string, queryGroupFn?: QueryGroupFn<T>): AngularFirestoreCollectionGroup<T> {\n const queryFn = queryGroupFn || (ref => ref);\n const collectionGroup: Query<T> = this.firestore.collectionGroup(collectionId) as firebase.firestore.Query<T>;\n return new AngularFirestoreCollectionGroup<T>(queryFn(collectionGroup), this);\n }\n\n /**\n * Create a reference to a Firestore Document based on a path or\n * DocumentReference. Note that documents are not queryable because they are\n * simply objects. However, documents have sub-collections that return a\n * Collection reference and can be queried.\n */\n doc<T>(path: string): AngularFirestoreDocument<T>;\n doc<T>(ref: DocumentReference): AngularFirestoreDocument<T>;\n doc<T>(pathOrRef: string | DocumentReference<T>): AngularFirestoreDocument<T> {\n let ref: DocumentReference<T>;\n if (typeof pathOrRef === 'string') {\n ref = this.firestore.doc(pathOrRef) as firebase.firestore.DocumentReference<T>;\n } else {\n ref = pathOrRef;\n }\n const refInZone = this.schedulers.ngZone.run(() => ref);\n return new AngularFirestoreDocument<T>(refInZone, this);\n }\n\n /**\n * Returns a generated Firestore Document Id.\n */\n createId() {\n return this.firestore.collection('_').doc().id;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFirestore, ENABLE_PERSISTENCE, PERSISTENCE_SETTINGS } from './firestore';\nimport { PersistenceSettings } from './interfaces';\n\n@NgModule({\n providers: [ AngularFirestore ]\n})\nexport class AngularFirestoreModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'fst-compat');\n }\n /**\n * Attempt to enable persistent storage, if possible\n */\n static enablePersistence(persistenceSettings?: PersistenceSettings): ModuleWithProviders<AngularFirestoreModule> {\n return {\n ngModule: AngularFirestoreModule,\n providers: [\n { provide: ENABLE_PERSISTENCE, useValue: true },\n { provide: PERSISTENCE_SETTINGS, useValue: persistenceSettings },\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ɵfirebaseAppFactory","ɵauthFactory","ɵcacheInstance","USE_AUTH_EMULATOR","AUTH_SETTINGS"],"mappings":";;;;;;;;;;;;;;;AAIA,SAAS,QAAQ,CAAI,GAAc,EAAE,YAA2B,cAAc,EAAA;AAC5E,IAAA,OAAO,IAAI,UAAU,CAAC,UAAU,IAAG;AACjC,QAAA,IAAI,WAAuB,CAAC;AAC5B,QAAA,IAAI,SAAS,IAAI,IAAI,EAAE;AACrB,YAAA,SAAS,CAAC,QAAQ,CAAC,MAAK;AACtB,gBAAA,WAAW,GAAG,GAAG,CAAC,UAAU,CAAC,EAAE,sBAAsB,EAAE,IAAI,EAAE,EAAE,UAAU,CAAC,CAAC;AAC7E,aAAC,CAAC,CAAC;SACJ;aAAM;AACL,YAAA,WAAW,GAAG,GAAG,CAAC,UAAU,CA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A,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,mBAAmB,EAAE;AACjE,aAAA;SACF,CAAC;KACH;uGAfU,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;wGAAtB,sBAAsB,EAAA,CAAA,CAAA;wGAAtB,sBAAsB,EAAA,SAAA,EAFtB,CAAE,gBAAgB,CAAE,EAAA,CAAA,CAAA;;2FAEpB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,SAAS,EAAE,CAAE,gBAAgB,CAAE;AAChC,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
@@ -1,102 +1,98 @@
1
- // base.mjs
2
- var proxyPolyfillCompat = {
3
- useEmulator: null,
4
- useFunctionsEmulator: null,
5
- httpsCallable: null
6
- };
1
+ import 'firebase/compat/functions';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, Injectable, Inject, Optional, NgModule } from '@angular/core';
4
+ import * as i1 from '@angular/fire';
5
+ import { VERSION } from '@angular/fire';
6
+ import * as i2 from '@angular/fire/app-check';
7
+ import { ɵfirebaseAppFactory as _firebaseAppFactory, ɵcacheInstance as _cacheInstance, ɵlazySDKProxy as _lazySDKProxy, FIREBASE_OPTIONS, FIREBASE_APP_NAME, ɵapplyMixins as _applyMixins } from '@angular/fire/compat';
8
+ import { of, from } from 'rxjs';
9
+ import { observeOn, switchMap, map, shareReplay } from 'rxjs/operators';
10
+ import firebase from 'firebase/compat/app';
7
11
 
8
- // functions.mjs
9
- import { Inject, Injectable, InjectionToken, NgZone, Optional } from "@angular/core";
10
- import { ɵAngularFireSchedulers } from "@angular/fire";
11
- import { AppCheckInstances } from "@angular/fire/app-check";
12
- import { ɵapplyMixins, ɵlazySDKProxy } from "@angular/fire/compat";
13
- import { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from "@angular/fire/compat";
14
- import { from, of } from "rxjs";
15
- import { map, observeOn, shareReplay, switchMap } from "rxjs/operators";
16
- import * as i0 from "@angular/core";
17
- import * as i1 from "@angular/fire";
18
- import * as i2 from "@angular/fire/app-check";
19
- var ORIGIN = new InjectionToken("angularfire2.functions.origin");
20
- var REGION = new InjectionToken("angularfire2.functions.region");
21
- var USE_EMULATOR = new InjectionToken("angularfire2.functions.use-emulator");
22
- var AngularFireFunctions = class _AngularFireFunctions {
23
- httpsCallable;
24
- constructor(options, name, zone, schedulers, region, origin, _useEmulator, _appCheckInstances) {
25
- const useEmulator = _useEmulator;
26
- const functions = of(void 0).pipe(observeOn(schedulers.outsideAngular), switchMap(() => import("firebase/compat/functions")), map(() => ɵfirebaseAppFactory(options, zone, name)), map((app) => ɵcacheInstance(`${app.name}.functions.${region || origin}`, "AngularFireFunctions", app.name, () => {
27
- let functions2;
28
- if (region && origin) {
29
- throw new Error("REGION and ORIGIN can't be used at the same time.");
30
- }
31
- functions2 = app.functions(region || origin || void 0);
32
- if (useEmulator) {
33
- functions2.useEmulator(...useEmulator);
34
- }
35
- return functions2;
36
- }, [region, origin, useEmulator])), shareReplay({ bufferSize: 1, refCount: false }));
37
- this.httpsCallable = (name2, options2) => (data) => from(functions).pipe(observeOn(schedulers.insideAngular), switchMap((functions2) => functions2.httpsCallable(name2, options2)(data)), map((r) => r.data));
38
- return ɵlazySDKProxy(this, functions, zone);
39
- }
40
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _AngularFireFunctions, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: REGION, optional: true }, { token: ORIGIN, optional: true }, { token: USE_EMULATOR, optional: true }, { token: i2.AppCheckInstances, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
41
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: _AngularFireFunctions, providedIn: "any" });
12
+ // DO NOT MODIFY, this file is autogenerated by tools/build.ts
13
+ // Export a null object with the same keys as firebase/compat/functions, so Proxy can work with proxy-polyfill in Internet Explorer
14
+ const proxyPolyfillCompat = {
15
+ useEmulator: null,
16
+ useFunctionsEmulator: null,
17
+ httpsCallable: null,
42
18
  };
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i0, type: AngularFireFunctions, decorators: [{
44
- type: Injectable,
45
- args: [{
46
- providedIn: "any"
47
- }]
48
- }], ctorParameters: () => [{ type: void 0, decorators: [{
49
- type: Inject,
50
- args: [FIREBASE_OPTIONS]
51
- }] }, { type: void 0, decorators: [{
52
- type: Optional
53
- }, {
54
- type: Inject,
55
- args: [FIREBASE_APP_NAME]
56
- }] }, { type: i0.NgZone }, { type: i1.ɵAngularFireSchedulers }, { type: void 0, decorators: [{
57
- type: Optional
58
- }, {
59
- type: Inject,
60
- args: [REGION]
61
- }] }, { type: void 0, decorators: [{
62
- type: Optional
63
- }, {
64
- type: Inject,
65
- args: [ORIGIN]
66
- }] }, { type: void 0, decorators: [{
67
- type: Optional
68
- }, {
69
- type: Inject,
70
- args: [USE_EMULATOR]
71
- }] }, { type: i2.AppCheckInstances, decorators: [{
72
- type: Optional
73
- }] }] });
74
- ɵapplyMixins(AngularFireFunctions, [proxyPolyfillCompat]);
75
19
 
76
- // functions.module.mjs
77
- import { NgModule } from "@angular/core";
78
- import { VERSION } from "@angular/fire";
79
- import firebase from "firebase/compat/app";
80
- import * as i02 from "@angular/core";
81
- var AngularFireFunctionsModule = class _AngularFireFunctionsModule {
82
- constructor() {
83
- firebase.registerVersion("angularfire", VERSION.full, "fn-compat");
84
- }
85
- static ɵfac = i02.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i02, type: _AngularFireFunctionsModule, deps: [], target: i02.ɵɵFactoryTarget.NgModule });
86
- static ɵmod = i02.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.3", ngImport: i02, type: _AngularFireFunctionsModule });
87
- static ɵinj = i02.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i02, type: _AngularFireFunctionsModule, providers: [AngularFireFunctions] });
88
- };
89
- i02.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.3", ngImport: i02, type: AngularFireFunctionsModule, decorators: [{
90
- type: NgModule,
91
- args: [{
92
- providers: [AngularFireFunctions]
93
- }]
94
- }], ctorParameters: () => [] });
95
- export {
96
- AngularFireFunctions,
97
- AngularFireFunctionsModule,
98
- ORIGIN,
99
- REGION,
100
- USE_EMULATOR
101
- };
20
+ const ORIGIN = new InjectionToken('angularfire2.functions.origin');
21
+ const REGION = new InjectionToken('angularfire2.functions.region');
22
+ const USE_EMULATOR = new InjectionToken('angularfire2.functions.use-emulator');
23
+ class AngularFireFunctions {
24
+ httpsCallable;
25
+ constructor(options, name, zone, schedulers, region, origin, _useEmulator, // can't use the tuple here
26
+ _appCheckInstances) {
27
+ const useEmulator = _useEmulator;
28
+ const functions = of(undefined).pipe(observeOn(schedulers.outsideAngular), switchMap(() => import('firebase/compat/functions')), map(() => _firebaseAppFactory(options, zone, name)), map(app => _cacheInstance(`${app.name}.functions.${region || origin}`, 'AngularFireFunctions', app.name, () => {
29
+ let functions;
30
+ if (region && origin) {
31
+ throw new Error('REGION and ORIGIN can\'t be used at the same time.');
32
+ }
33
+ functions = app.functions(region || origin || undefined);
34
+ if (useEmulator) {
35
+ functions.useEmulator(...useEmulator);
36
+ }
37
+ return functions;
38
+ }, [region, origin, useEmulator])), shareReplay({ bufferSize: 1, refCount: false }));
39
+ this.httpsCallable = (name, options) => (data) => from(functions).pipe(observeOn(schedulers.insideAngular), switchMap(functions => functions.httpsCallable(name, options)(data)), map(r => r.data));
40
+ return _lazySDKProxy(this, functions, zone);
41
+ }
42
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireFunctions, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: REGION, optional: true }, { token: ORIGIN, optional: true }, { token: USE_EMULATOR, optional: true }, { token: i2.AppCheckInstances, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
43
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireFunctions, providedIn: 'any' });
44
+ }
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireFunctions, decorators: [{
46
+ type: Injectable,
47
+ args: [{
48
+ providedIn: 'any'
49
+ }]
50
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
51
+ type: Inject,
52
+ args: [FIREBASE_OPTIONS]
53
+ }] }, { type: undefined, decorators: [{
54
+ type: Optional
55
+ }, {
56
+ type: Inject,
57
+ args: [FIREBASE_APP_NAME]
58
+ }] }, { type: i0.NgZone }, { type: i1.ɵAngularFireSchedulers }, { type: undefined, decorators: [{
59
+ type: Optional
60
+ }, {
61
+ type: Inject,
62
+ args: [REGION]
63
+ }] }, { type: undefined, decorators: [{
64
+ type: Optional
65
+ }, {
66
+ type: Inject,
67
+ args: [ORIGIN]
68
+ }] }, { type: undefined, decorators: [{
69
+ type: Optional
70
+ }, {
71
+ type: Inject,
72
+ args: [USE_EMULATOR]
73
+ }] }, { type: i2.AppCheckInstances, decorators: [{
74
+ type: Optional
75
+ }] }] });
76
+ _applyMixins(AngularFireFunctions, [proxyPolyfillCompat]);
77
+
78
+ class AngularFireFunctionsModule {
79
+ constructor() {
80
+ firebase.registerVersion('angularfire', VERSION.full, 'fn-compat');
81
+ }
82
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireFunctionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
83
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: AngularFireFunctionsModule });
84
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireFunctionsModule, providers: [AngularFireFunctions] });
85
+ }
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AngularFireFunctionsModule, decorators: [{
87
+ type: NgModule,
88
+ args: [{
89
+ providers: [AngularFireFunctions]
90
+ }]
91
+ }], ctorParameters: () => [] });
92
+
93
+ /**
94
+ * Generated bundle index. Do not edit.
95
+ */
96
+
97
+ export { AngularFireFunctions, AngularFireFunctionsModule, ORIGIN, REGION, USE_EMULATOR };
102
98
  //# sourceMappingURL=angular-fire-compat-functions.mjs.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/compat/functions/base.ts", "../../../src/compat/functions/functions.ts", "../../../src/compat/functions/functions.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/functions, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n useEmulator: null,\n useFunctionsEmulator: null,\n httpsCallable: null,\n};\n", "import { Inject, Injectable, InjectionToken, NgZone, Optional } from '@angular/core';\nimport { ɵAngularFireSchedulers } from '@angular/fire';\nimport { AppCheckInstances } from '@angular/fire/app-check';\nimport { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat';\nimport { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat';\nimport { HttpsCallableOptions } from '@firebase/functions-types';\nimport { FirebaseOptions } from 'firebase/app';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from, of } from 'rxjs';\nimport { map, observeOn, shareReplay, switchMap } from 'rxjs/operators';\nimport { proxyPolyfillCompat } from './base';\n\nexport const ORIGIN = new InjectionToken<string>('angularfire2.functions.origin');\nexport const REGION = new InjectionToken<string>('angularfire2.functions.region');\n\ntype UseEmulatorArguments = Parameters<firebase.functions.Functions['useEmulator']>;\nexport const USE_EMULATOR = new InjectionToken<UseEmulatorArguments>('angularfire2.functions.use-emulator');\n\n// override httpsCallable for compatibility with 5.x\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface AngularFireFunctions extends Omit<ɵPromiseProxy<firebase.functions.Functions>, 'httpsCallable'> {\n}\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFireFunctions {\n\n public readonly httpsCallable: <T = any, R = any>(name: string, options?: HttpsCallableOptions) => (data: T) => Observable<R>;\n\n constructor(\n @Inject(FIREBASE_OPTIONS) options: FirebaseOptions,\n @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined,\n zone: NgZone,\n schedulers: ɵAngularFireSchedulers,\n @Optional() @Inject(REGION) region: string | null,\n @Optional() @Inject(ORIGIN) origin: string | null,\n @Optional() @Inject(USE_EMULATOR) _useEmulator: any, // can't use the tuple here\n @Optional() _appCheckInstances: AppCheckInstances,\n ) {\n const useEmulator: UseEmulatorArguments | null = _useEmulator;\n\n const functions = of(undefined).pipe(\n observeOn(schedulers.outsideAngular),\n switchMap(() => import('firebase/compat/functions')),\n map(() => ɵfirebaseAppFactory(options, zone, name)),\n map(app => ɵcacheInstance(`${app.name}.functions.${region || origin}`, 'AngularFireFunctions', app.name, () => {\n let functions: firebase.functions.Functions;\n if (region && origin) {\n throw new Error('REGION and ORIGIN can\\'t be used at the same time.');\n }\n functions = app.functions(region || origin || undefined);\n if (useEmulator) {\n functions.useEmulator(...useEmulator);\n }\n return functions;\n }, [region, origin, useEmulator])),\n shareReplay({ bufferSize: 1, refCount: false })\n );\n\n this.httpsCallable = <T = any, R = any>(name: string, options?: HttpsCallableOptions) =>\n (data: T) => from(functions).pipe(\n observeOn(schedulers.insideAngular),\n switchMap(functions => functions.httpsCallable(name, options)(data)),\n map(r => r.data as R)\n );\n\n return ɵlazySDKProxy(this, functions, zone);\n\n }\n\n}\n\nɵapplyMixins(AngularFireFunctions, [proxyPolyfillCompat]);\n", "import { NgModule } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFireFunctions } from './functions';\n\n@NgModule({\n providers: [ AngularFireFunctions ]\n})\nexport class AngularFireFunctionsModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'fn-compat');\n }\n}\n"],
5
- "mappings": ";AAEO,IAAM,sBAAsB;EACjC,aAAa;EACb,sBAAsB;EACtB,eAAe;;;;ACLjB,SAAS,QAAQ,YAAY,gBAAgB,QAAQ,gBAAgB;AACrE,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAClC,SAAwB,cAAc,qBAAqB;AAC3D,SAAS,mBAAmB,kBAAkB,gBAAgB,2BAA2B;AAIzF,SAAqB,MAAM,UAAU;AACrC,SAAS,KAAK,WAAW,aAAa,iBAAiB;;;;AAGhD,IAAM,SAAS,IAAI,eAAuB,+BAA+B;AACzE,IAAM,SAAS,IAAI,eAAuB,+BAA+B;AAGzE,IAAM,eAAe,IAAI,eAAqC,qCAAqC;AAUpG,IAAO,uBAAP,MAAO,sBAAoB;EAEf;EAEhB,YAC4B,SACa,MACvC,MACA,YAC4B,QACA,QACM,cACtB,oBAAqC;AAEjD,UAAM,cAA2C;AAEjD,UAAM,YAAY,GAAG,MAAS,EAAE,KAC9B,UAAU,WAAW,cAAc,GACnC,UAAU,MAAM,OAAO,2BAA2B,CAAC,GACnD,IAAI,MAAM,oBAAoB,SAAS,MAAM,IAAI,CAAC,GAClD,IAAI,SAAO,eAAe,GAAG,IAAI,IAAI,cAAc,UAAU,MAAM,IAAI,wBAAwB,IAAI,MAAM,MAAK;AAC5G,UAAIA;AACJ,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AA;AACE,aAAS,gBAAgB,eAAe,QAAQ,MAAM,WAAW;EACnE;4GAHW,6BAA0B,MAAA,CAAA,GAAA,QAAA,oBAAA,SAAA,CAAA;6GAA1B,4BAA0B,CAAA;6GAA1B,6BAA0B,WAF1B,CAAE,oBAAoB,EAAE,CAAA;;kGAExB,4BAA0B,YAAA,CAAA;QAHtC;SAAS;IACR,WAAW,CAAE,oBAAoB;GAClC;;",
6
- "names": ["functions", "name", "options"]
7
- }
1
+ {"version":3,"file":"angular-fire-compat-functions.mjs","sources":["../../../src/compat/functions/base.ts","../../../src/compat/functions/functions.ts","../../../src/compat/functions/functions.module.ts","../../../src/compat/functions/angular-fire-compat-functions.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/functions, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n useEmulator: null,\n useFunctionsEmulator: null,\n httpsCallable: null,\n};\n","import { Inject, Injectable, InjectionToken, NgZone, Optional } from '@angular/core';\nimport { ɵAngularFireSchedulers } from '@angular/fire';\nimport { AppCheckInstances } from '@angular/fire/app-check';\nimport { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat';\nimport { FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat';\nimport { HttpsCallableOptions } from '@firebase/functions-types';\nimport { FirebaseOptions } from 'firebase/app';\nimport firebase from 'firebase/compat/app';\nimport { Observable, from, of } from 'rxjs';\nimport { map, observeOn, shareReplay, switchMap } from 'rxjs/operators';\nimport { proxyPolyfillCompat } from './base';\n\nexport const ORIGIN = new InjectionToken<string>('angularfire2.functions.origin');\nexport const REGION = new InjectionToken<string>('angularfire2.functions.region');\n\ntype UseEmulatorArguments = Parameters<firebase.functions.Functions['useEmulator']>;\nexport const USE_EMULATOR = new InjectionToken<UseEmulatorArguments>('angularfire2.functions.use-emulator');\n\n// override httpsCallable for compatibility with 5.x\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface AngularFireFunctions extends Omit<ɵPromiseProxy<firebase.functions.Functions>, 'httpsCallable'> {\n}\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFireFunctions {\n\n public readonly httpsCallable: <T = any, R = any>(name: string, options?: HttpsCallableOptions) => (data: T) => Observable<R>;\n\n constructor(\n @Inject(FIREBASE_OPTIONS) options: FirebaseOptions,\n @Optional() @Inject(FIREBASE_APP_NAME) name: string | null | undefined,\n zone: NgZone,\n schedulers: ɵAngularFireSchedulers,\n @Optional() @Inject(REGION) region: string | null,\n @Optional() @Inject(ORIGIN) origin: string | null,\n @Optional() @Inject(USE_EMULATOR) _useEmulator: any, // can't use the tuple here\n @Optional() _appCheckInstances: AppCheckInstances,\n ) {\n const useEmulator: UseEmulatorArguments | null = _useEmulator;\n\n const functions = of(undefined).pipe(\n observeOn(schedulers.outsideAngular),\n switchMap(() => import('firebase/compat/functions')),\n map(() => ɵfirebaseAppFactory(options, zone, name)),\n map(app => ɵcacheInstance(`${app.name}.functions.${region || origin}`, 'AngularFireFunctions', app.name, () => {\n let functions: firebase.functions.Functions;\n if (region && origin) {\n throw new Error('REGION and ORIGIN can\\'t be used at the same time.');\n }\n functions = app.functions(region || origin || undefined);\n if (useEmulator) {\n functions.useEmulator(...useEmulator);\n }\n return functions;\n }, [region, origin, useEmulator])),\n shareReplay({ bufferSize: 1, refCount: false })\n );\n\n this.httpsCallable = <T = any, R = any>(name: string, options?: HttpsCallableOptions) =>\n (data: T) => from(functions).pipe(\n observeOn(schedulers.insideAngular),\n switchMap(functions => functions.httpsCallable(name, options)(data)),\n map(r => r.data as R)\n );\n\n return ɵlazySDKProxy(this, functions, zone);\n\n }\n\n}\n\nɵapplyMixins(AngularFireFunctions, [proxyPolyfillCompat]);\n","import { NgModule } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFireFunctions } from './functions';\n\n@NgModule({\n providers: [ AngularFireFunctions ]\n})\nexport class AngularFireFunctionsModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'fn-compat');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ɵfirebaseAppFactory","ɵcacheInstance","ɵlazySDKProxy","ɵapplyMixins"],"mappings":";;;;;;;;;;;AAAA;AACA;AACO,MAAM,mBAAmB,GAAG;AACjC,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,oBAAoB,EAAE,IAAI;AAC1B,IAAA,aAAa,EAAE,IAAI;CACpB;;MCMY,MAAM,GAAG,IAAI,cAAc,CAAS,+BAA+B,EAAE;MACrE,MAAM,GAAG,IAAI,cAAc,CAAS,+BAA+B,EAAE;MAGrE,YAAY,GAAG,IAAI,cAAc,CAAuB,qCAAqC,EAAE;MAU/F,oBAAoB,CAAA;AAEf,IAAA,aAAa,CAAiG;AAE9H,IAAA,WAAA,CAC4B,OAAwB,EACX,IAA+B,EACtE,IAAY,EACZ,UAAkC,EACN,MAAqB,EACrB,MAAqB,EACf,YAAiB;IACvC,kBAAqC,EAAA;QAEjD,MAAM,WAAW,GAAgC,YAAY,CAAC;AAE9D,QAAA,MAAM,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,CAClC,SAAS,CAAC,UAAU,CAAC,cAAc,CAAC,EACpC,SAAS,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC,EACpD,GAAG,CAAC,MAAMA,mBAAmB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EACnD,GAAG,CAAC,GAAG,IAAIC,cAAc,CAAC,CAAA,EAAG,GAAG,CAAC,IAAI,CAAA,WAAA,EAAc,MAAM,IAAI,MAAM,CAAE,CAAA,EAAE,sBAAsB,EAAE,GAAG,CAAC,IAAI,EAAE,MAAK;AAC5G,YAAA,IAAI,SAAuC,CAAC;AAC5C,YAAA,IAAI,MAAM,IAAI,MAAM,EA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