Kargi-Sitesi/node_modules/@angular/fire/fesm2015/angular-fire-compat-auth.js.map

1 line
No EOL
16 KiB
Text

{"version":3,"file":"angular-fire-compat-auth.js","sources":["../../../src/compat/auth/base.ts","../../../src/compat/auth/auth.ts","../../../src/compat/auth/auth.module.ts","../../../src/compat/auth/angular-fire-compat-auth.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/auth, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n name: null,\n config: null,\n emulatorConfig: null,\n app: null,\n applyActionCode: null,\n checkActionCode: null,\n confirmPasswordReset: null,\n createUserWithEmailAndPassword: null,\n currentUser: null,\n fetchSignInMethodsForEmail: null,\n isSignInWithEmailLink: null,\n getRedirectResult: null,\n languageCode: null,\n settings: null,\n onAuthStateChanged: null,\n onIdTokenChanged: null,\n sendSignInLinkToEmail: null,\n sendPasswordResetEmail: null,\n setPersistence: null,\n signInAndRetrieveDataWithCredential: null,\n signInAnonymously: null,\n signInWithCredential: null,\n signInWithCustomToken: null,\n signInWithEmailAndPassword: null,\n signInWithPhoneNumber: null,\n signInWithEmailLink: null,\n signInWithPopup: null,\n signInWithRedirect: null,\n signOut: null,\n tenantId: null,\n updateCurrentUser: null,\n useDeviceLanguage: null,\n useEmulator: null,\n verifyPasswordResetCode: null,\n};\n","import { Injectable, Inject, Optional, NgZone, PLATFORM_ID, InjectionToken } from '@angular/core';\nimport { Observable, of, from, merge, Subject } from 'rxjs';\nimport { switchMap, map, observeOn, shareReplay, first, filter, switchMapTo, subscribeOn } from 'rxjs/operators';\nimport { ɵAngularFireSchedulers, keepUnstableUntilFirst } from '@angular/fire';\nimport { ɵlazySDKProxy, ɵPromiseProxy, ɵapplyMixins } from '@angular/fire/compat';\nimport { ɵfirebaseAppFactory, FIREBASE_OPTIONS, FIREBASE_APP_NAME, FirebaseApp, ɵcacheInstance } from '@angular/fire/compat';\nimport { FirebaseOptions } from 'firebase/app';\nimport firebase from 'firebase/compat/app';\nimport { isPlatformServer } from '@angular/common';\nimport { proxyPolyfillCompat } from './base';\nimport { AppCheckInstances } from '@angular/fire/app-check';\n\nexport interface AngularFireAuth extends ɵPromiseProxy<firebase.auth.Auth> {}\n\ntype UseEmulatorArguments = Parameters<firebase.auth.Auth['useEmulator']>;\nexport const USE_EMULATOR = new InjectionToken<UseEmulatorArguments>('angularfire2.auth.use-emulator');\n\nexport const SETTINGS = new InjectionToken<firebase.auth.AuthSettings>('angularfire2.auth.settings');\nexport const TENANT_ID = new InjectionToken<string>('angularfire2.auth.tenant-id');\nexport const LANGUAGE_CODE = new InjectionToken<string>('angularfire2.auth.langugage-code');\nexport const USE_DEVICE_LANGUAGE = new InjectionToken<boolean>('angularfire2.auth.use-device-language');\nexport const PERSISTENCE = new InjectionToken<string>('angularfire.auth.persistence');\n\nexport const ɵauthFactory = (\n app: FirebaseApp, zone: NgZone, useEmulator: UseEmulatorArguments|null,\n tenantId: string, languageCode: string|null, useDeviceLanguage: boolean|null,\n settings: firebase.auth.AuthSettings|null, persistence: string|null,\n) => ɵcacheInstance(`${app.name}.auth`, 'AngularFireAuth', app.name, () => {\n const auth = zone.runOutsideAngular(() => app.auth());\n if (useEmulator) {\n auth.useEmulator(...useEmulator);\n }\n if (tenantId) {\n auth.tenantId = tenantId;\n }\n auth.languageCode = languageCode;\n if (useDeviceLanguage) {\n auth.useDeviceLanguage();\n }\n if (settings) {\n for (const [k, v] of Object.entries(settings)) {\n auth.settings[k] = v;\n }\n }\n if (persistence) {\n auth.setPersistence(persistence);\n }\n return auth;\n}, [useEmulator, tenantId, languageCode, useDeviceLanguage, settings, persistence]);\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFireAuth {\n\n /**\n * Observable of authentication state; as of Firebase 4.0 this is only triggered via sign-in/out\n */\n public readonly authState: Observable<firebase.User|null>;\n\n /**\n * Observable of the currently signed-in user's JWT token used to identify the user to a Firebase service (or null).\n */\n public readonly idToken: Observable<string|null>;\n\n /**\n * Observable of the currently signed-in user (or null).\n */\n public readonly user: Observable<firebase.User|null>;\n\n /**\n * Observable of the currently signed-in user's IdTokenResult object which contains the ID token JWT string and other\n * helper properties for getting different data associated with the token as well as all the decoded payload claims\n * (or null).\n */\n public readonly idTokenResult: Observable<firebase.auth.IdTokenResult|null>;\n\n /**\n * Observable of the currently signed-in user's credential, or null\n */\n public readonly credential: Observable<Required<firebase.auth.UserCredential>|null>;\n\n constructor(\n @Inject(FIREBASE_OPTIONS) options: FirebaseOptions,\n @Optional() @Inject(FIREBASE_APP_NAME) name: string|null|undefined,\n // tslint:disable-next-line:ban-types\n @Inject(PLATFORM_ID) platformId: Object,\n zone: NgZone,\n schedulers: ɵAngularFireSchedulers,\n @Optional() @Inject(USE_EMULATOR) useEmulator: any, // can't use the tuple here\n @Optional() @Inject(SETTINGS) settings: 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 logins = new Subject<Required<firebase.auth.UserCredential>>();\n\n const auth = of(undefined).pipe(\n observeOn(schedulers.outsideAngular),\n switchMap(() => zone.runOutsideAngular(() => import('firebase/compat/auth'))),\n map(() => ɵfirebaseAppFactory(options, zone, name)),\n map(app => ɵauthFactory(app, zone, useEmulator, tenantId, languageCode, useDeviceLanguage, settings, persistence)),\n shareReplay({ bufferSize: 1, refCount: false }),\n );\n\n if (isPlatformServer(platformId)) {\n\n this.authState = this.user = this.idToken = this.idTokenResult = this.credential = of(null);\n\n } else {\n\n // HACK, as we're exporting auth.Auth, rather than auth, developers importing firebase.auth\n // (e.g, `import { auth } from 'firebase/compat/app'`) are getting an undefined auth object unexpectedly\n // as we're completely lazy. Let's eagerly load the Auth SDK here.\n // There could potentially be race conditions still... but this greatly decreases the odds while\n // we reevaluate the API.\n const _ = auth.pipe(first()).subscribe();\n\n const redirectResult = auth.pipe(\n switchMap(auth => auth.getRedirectResult().then(it => it, () => null)),\n keepUnstableUntilFirst,\n shareReplay({ bufferSize: 1, refCount: false }),\n );\n\n const authStateChanged = auth.pipe(\n switchMap(auth => new Observable<firebase.User|null>(sub =>\n ({ unsubscribe: zone.runOutsideAngular(() => auth.onAuthStateChanged(\n next => sub.next(next),\n err => sub.error(err),\n () => sub.complete()\n ))})\n )),\n );\n\n const idTokenChanged = auth.pipe(\n switchMap(auth => new Observable<firebase.User|null>(sub =>\n ({ unsubscribe: zone.runOutsideAngular(() => auth.onIdTokenChanged(\n next => sub.next(next),\n err => sub.error(err),\n () => sub.complete()\n ))})\n ))\n );\n\n this.authState = redirectResult.pipe(\n switchMapTo(authStateChanged),\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n\n this.user = redirectResult.pipe(\n switchMapTo(idTokenChanged),\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n\n this.idToken = this.user.pipe(\n switchMap(user => user ? from(user.getIdToken()) : of(null))\n );\n\n this.idTokenResult = this.user.pipe(\n switchMap(user => user ? from(user.getIdTokenResult()) : of(null))\n );\n\n this.credential = merge(\n redirectResult,\n logins,\n // pipe in null authState to make credential zipable, just a weird devexp if\n // authState and user go null to still have a credential\n this.authState.pipe(filter(it => !it))\n ).pipe(\n // handle the { user: { } } when a user is already logged in, rather have null\n // TODO handle the type corcersion better\n map(credential => credential?.user ? credential as Required<firebase.auth.UserCredential> : null),\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n\n }\n\n return ɵlazySDKProxy(this, auth, zone, { spy: {\n apply: (name, _, val) => {\n // If they call a signIn or createUser function listen into the promise\n // this will give us the user credential, push onto the logins Subject\n // to be consumed in .credential\n if (name.startsWith('signIn') || name.startsWith('createUser')) {\n // TODO fix the types, the trouble is UserCredential has everything optional\n val.then((user: firebase.auth.UserCredential) => logins.next(user as any));\n }\n }\n }});\n\n }\n\n}\n\nɵapplyMixins(AngularFireAuth, [proxyPolyfillCompat]);\n","import { NgModule } from '@angular/core';\nimport { AngularFireAuth } from './auth';\nimport firebase from 'firebase/compat/app';\nimport { VERSION } from '@angular/fire';\n\n@NgModule({\n providers: [ AngularFireAuth ]\n})\nexport class AngularFireAuthModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'auth-compat');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;AACO,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,IAAI;IACpB,GAAG,EAAE,IAAI;IACT,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE,IAAI;IACrB,oBAAoB,EAAE,IAAI;IAC1B,8BAA8B,EAAE,IAAI;IACpC,WAAW,EAAE,IAAI;IACjB,0BAA0B,EAAE,IAAI;IAChC,qBAAqB,EAAE,IAAI;IAC3B,iBAAiB,EAAE,IAAI;IACvB,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,IAAI;IACd,kBAAkB,EAAE,IAAI;IACxB,gBAAgB,EAAE,IAAI;IACtB,qBAAqB,EAAE,IAAI;IAC3B,sBAAsB,EAAE,IAAI;IAC5B,cAAc,EAAE,IAAI;IACpB,mCAAmC,EAAE,IAAI;IACzC,iBAAiB,EAAE,IAAI;IACvB,oBAAoB,EAAE,IAAI;IAC1B,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;IAChC,qBAAqB,EAAE,IAAI;IAC3B,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,IAAI;IACxB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE,IAAI;IACvB,iBAAi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