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

1 line
21 KiB
Text
Raw Normal View History

2024-11-04 02:30:09 +00:00
{"version":3,"file":"angular-fire-compat-remote-config.js","sources":["../../../src/compat/remote-config/base.ts","../../../src/compat/remote-config/remote-config.ts","../../../src/compat/remote-config/remote-config.module.ts","../../../src/compat/remote-config/angular-fire-compat-remote-config.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/remote-config, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n app: null,\n settings: null,\n defaultConfig: null,\n fetchTimeMillis: null,\n lastFetchStatus: null,\n activate: null,\n ensureInitialized: null,\n fetch: null,\n fetchAndActivate: null,\n getAll: null,\n getBoolean: null,\n getNumber: null,\n getString: null,\n getValue: null,\n setLogLevel: null,\n};\n","import { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';\nimport { concat, EMPTY, MonoTypeOperatorFunction, Observable, of, OperatorFunction, pipe } from 'rxjs';\nimport {\n debounceTime,\n distinctUntilChanged,\n filter,\n groupBy,\n map,\n mergeMap,\n observeOn,\n scan,\n shareReplay,\n startWith,\n switchMap,\n withLatestFrom\n} from 'rxjs/operators';\nimport { ɵAngularFireSchedulers, keepUnstableUntilFirst } from '@angular/fire';\nimport { ɵlazySDKProxy, ɵPromiseProxy, ɵapplyMixins } from '@angular/fire/compat';\nimport { FirebaseOptions } from 'firebase/app';\nimport { ɵfirebaseAppFactory, FIREBASE_APP_NAME, FIREBASE_OPTIONS, ɵcacheInstance } from '@angular/fire/compat';\nimport firebase from 'firebase/compat/app';\nimport { Settings } from './interfaces';\nimport { proxyPolyfillCompat } from './base';\nimport { isSupported } from 'firebase/remote-config';\n\nexport interface ConfigTemplate {\n [key: string]: string | number | boolean;\n}\n\nexport const SETTINGS = new InjectionToken<Settings>('angularfire2.remoteConfig.settings');\nexport const DEFAULTS = new InjectionToken<ConfigTemplate>('angularfire2.remoteConfig.defaultConfig');\n\nexport interface AngularFireRemoteConfig extends ɵPromiseProxy<firebase.remoteConfig.RemoteConfig> {\n}\n\nconst AS_TO_FN = { strings: 'asString', numbers: 'asNumber', booleans: 'asBoolean' };\nconst STATIC_VALUES = { numbers: 0, booleans: false, strings: undefined };\n\n// TODO look into the types here, I don't like the anys\nconst proxyAll = (observable: Observable<Parameter[]>, as: 'numbers' | 'booleans' | 'strings') => new Proxy(\n observable.pipe(mapToObject(as as any)), {\n get: (self, name: string) => self[name] || observable.pipe(\n map(all => all.find(p => p.key === name)),\n map(param => param ? param[AS_TO_FN[as]]() : STATIC_VALUES[as]),\n distinctUntilChanged()\n )\n }\n) as any;\n\n// TODO export as implements Partial<...> so minor doesn't break us\nexport class Value implements firebase.remoteConfig.Value {\n asBoolean() {\n return ['1', 'true', 't', 'y', 'yes', 'on'].indexOf(this._value.toLowerCase()) > -1;\n }\n\n asString() {\n return this._value;\n }\n\n asNumber() {\n return Number(this._value) || 0;\n }\n\n getSource() {\n return this._source;\n }\n\n // tslint:disable-next-line:variable-name\n constructor(public _source: firebase.remoteConfig.ValueSource, public _value: string) {\n }\n}\n\n// SEMVER use ConstructorParameters when we can support Typescript 3.6\nexport class Parameter extends Value {\n constructor(public key: string, public fetchTimeMillis: number, source: firebase.remoteConfig.ValueSource, value: string) {\n super(source, value);\n }\n}\n\n// If it's a Parameter array, test any, else test the individual Parameter\nconst filterTest = (fn: (param: Parameter) => boolean) => filter<Parameter | Parameter[]>(it => Array.isArray(it) ? it.some(fn) : fn(it));\n\n// Allow the user to bypass the default values and wait till they get something from the server, even if it's a cached copy;\n// if used in conjuntion with first() it will only fetch RC values from the server if they ar