1 line
6.6 KiB
Text
1 line
6.6 KiB
Text
|
{"version":3,"file":"angular-fire-messaging.js","sources":["../../../src/messaging/messaging.ts","../../../src/messaging/messaging.module.ts","../../../src/messaging/overrides.ts","../../../src/messaging/firebase.ts","../../../src/messaging/angular-fire-messaging.ts"],"sourcesContent":["import { Messaging as FirebaseMessaging } from 'firebase/messaging';\nimport { ɵgetAllInstancesOf } from '@angular/fire';\nimport { from, timer } from 'rxjs';\nimport { concatMap, distinct } from 'rxjs/operators';\n\n// see notes in core/firebase.app.module.ts for why we're building the class like this\n// tslint:disable-next-line:no-empty-interface\nexport interface Messaging extends FirebaseMessaging {}\n\nexport class Messaging {\n constructor(messaging: FirebaseMessaging) {\n return messaging;\n }\n}\n\nexport const MESSAGING_PROVIDER_NAME = 'messaging';\n\n// tslint:disable-next-line:no-empty-interface\nexport interface MessagingInstances extends Array<FirebaseMessaging> {}\n\nexport class MessagingInstances {\n constructor() {\n return ɵgetAllInstancesOf<FirebaseMessaging>(MESSAGING_PROVIDER_NAME);\n }\n}\n\nexport const messagingInstance$ = timer(0, 300).pipe(\n concatMap(() => from(ɵgetAllInstancesOf<FirebaseMessaging>(MESSAGING_PROVIDER_NAME))),\n distinct(),\n);\n","import { NgModule, Optional, NgZone, InjectionToken, ModuleWithProviders, Injector, APP_INITIALIZER } from '@angular/core';\nimport { Messaging as FirebaseMessaging } from 'firebase/messaging';\nimport { ɵgetDefaultInstanceOf, ɵAngularFireSchedulers, VERSION, ɵisMessagingSupportedFactory } from '@angular/fire';\nimport { Messaging, MessagingInstances, MESSAGING_PROVIDER_NAME } from './messaging';\nimport { FirebaseApps, FirebaseApp } from '@angular/fire/app';\nimport { registerVersion } from 'firebase/app';\n\nconst PROVIDED_MESSAGING_INSTANCES = new InjectionToken<Messaging[]>('angularfire2.messaging-instances');\n\nexport function defaultMessagingInstanceFactory(provided: FirebaseMessaging[]|undefined, defaultApp: FirebaseApp) {\n if (!ɵisMessagingSupportedFactory.sync()) { return null; }\n const defaultMessaging = ɵgetDefaultInstanceOf<FirebaseMessaging>(MESSAGING_PROVIDER_NAME, provided, defaultApp);\n return defaultMessaging && new Messaging(defaultMessaging);\n}\n\nexport function messagingInstanceFactory(fn: (injector: Injector) => FirebaseMessaging) {\n return (zone: NgZone, injector: Injector) => {\n if (!ɵisMessagingSupportedFactory.sync()) { return null; }\n const messaging = zone.runOutsideAngular(() => fn(injector));\n return new Messaging(messaging);\n };\n}\n\nconst MESSAGING_INSTANCES_PROVIDER = {\n provide: MessagingInstances,\n deps: [\n [new Optional(), PROVIDED_MESSAGING_INSTANCES ],\n ]\n};\n\nconst DEFAULT_MESSAGING_INSTANCE_PROVIDER = {\n provide: Messaging,\n useFactory: defaultMessagingInstanceFactory,\n deps: [\n [new Optional(), PROVIDED_MESSAGING_INSTANCES ],\n FirebaseApp,\n ]\n};\n\n@NgModule({\n providers: [\n DEFAULT_MESSAGING_INSTANCE_PROVIDER,\n MESSAGING_INSTANCES_PROVIDER,\n {\n provide: APP_INITIALIZER,\n useValue: ɵisMessagingSupportedFactory.async,\n multi: true,\n },\n ]\n})\nexport class MessagingModule {\n constructor() {\n registerVersion('angularfire', VERSION.full, 'fcm');\n }\n}\n\nexport function provideMessaging(fn: (injector: Injector) => FirebaseMessaging, ...deps: any[]): ModuleWithProviders<MessagingModule> {\n return {\n ngModule: MessagingModule,\n providers: [{\n provide: PROVIDED_MESSAGING_INSTANCES,\n useFactory: messagingInstanceFactory(fn),\n multi: true,\n deps: [\n NgZone,\n Injector,\n ɵAngularFireSchedulers,\n FirebaseApps,\n ...deps,\n ],\n }]\n };\n}\n","import { ɵisMessagingSupportedFactory } from '@angular/fire';\n\nexport const isSupported = ɵisMessagingSupportedFactory.async;\n","// DO NOT MODIFY, this file is autogenerated by tools/build.ts\nexport * from 'firebase/messaging';\nimport { ɵzoneWrap } from '@angular/fire';\nimport {\n delete
|