firebase 9.6.2-canary.044a8d7f9 → 9.6.2-canary.88d43ec00

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 (44) hide show
  1. package/app/dist/index.cjs.js +1 -1
  2. package/app/dist/index.esm.js +1 -1
  3. package/app/dist/index.mjs +1 -1
  4. package/compat/app/dist/index.cjs.js +1 -1
  5. package/compat/app/dist/index.esm.js +1 -1
  6. package/compat/app/dist/index.mjs +1 -1
  7. package/compat/dist/index.esm.js +2 -2
  8. package/compat/dist/index.node.cjs +2 -2
  9. package/compat/dist/index.rn.cjs.js +2 -2
  10. package/firebase-analytics-compat.js +1 -1
  11. package/firebase-analytics.js +5 -5
  12. package/firebase-app-check-compat.js +1 -1
  13. package/firebase-app-check.js +5 -5
  14. package/firebase-app-compat.js +2 -2
  15. package/firebase-app.js +9 -9
  16. package/firebase-auth-compat.js +1 -1
  17. package/firebase-auth.js +3 -3
  18. package/firebase-compat.js +4 -4
  19. package/firebase-compat.js.map +1 -1
  20. package/firebase-database-compat.js +1 -1
  21. package/firebase-database.js +5 -5
  22. package/firebase-firestore-compat.js +1 -1
  23. package/firebase-firestore-compat.js.map +1 -1
  24. package/firebase-firestore-lite.js +129 -129
  25. package/firebase-firestore-lite.js.map +1 -1
  26. package/firebase-firestore.js +874 -874
  27. package/firebase-firestore.js.map +1 -1
  28. package/firebase-functions-compat.js +1 -1
  29. package/firebase-functions.js +3 -3
  30. package/firebase-messaging-compat.js +1 -1
  31. package/firebase-messaging-compat.js.map +1 -1
  32. package/firebase-messaging-sw.js +5 -5
  33. package/firebase-messaging-sw.js.map +1 -1
  34. package/firebase-messaging.js +4 -4
  35. package/firebase-messaging.js.map +1 -1
  36. package/firebase-performance-compat.js +1 -1
  37. package/firebase-performance-standalone-compat.es2017.js +7 -7
  38. package/firebase-performance-standalone-compat.js +1 -1
  39. package/firebase-performance.js +5 -5
  40. package/firebase-remote-config-compat.js +1 -1
  41. package/firebase-remote-config.js +4 -4
  42. package/firebase-storage-compat.js +1 -1
  43. package/firebase-storage.js +2 -2
  44. package/package.json +26 -26
@@ -1,4 +1,4 @@
1
- import { registerVersion, _registerComponent, _getProvider, getApp } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.044a8d7f9/firebase-app.js';
1
+ import { registerVersion, _registerComponent, _getProvider, getApp } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js';
2
2
 
3
3
  /**
4
4
  * @license
@@ -730,7 +730,7 @@ function openDb(name, version, upgradeCallback) {
730
730
  }
731
731
 
732
732
  const name$1 = "@firebase/installations";
733
- const version$1 = "0.5.5-canary.044a8d7f9";
733
+ const version$1 = "0.5.5-canary.88d43ec00";
734
734
 
735
735
  /**
736
736
  * @license
@@ -1695,7 +1695,7 @@ registerVersion(name$1, version$1);
1695
1695
  registerVersion(name$1, version$1, 'esm2017');
1696
1696
 
1697
1697
  const name = "@firebase/performance";
1698
- const version = "0.5.5-canary.044a8d7f9";
1698
+ const version = "0.5.5-canary.88d43ec00";
1699
1699
 
1700
1700
  /**
1701
1701
  * @license
@@ -3119,7 +3119,7 @@ class PerformanceController {
3119
3119
  const DEFAULT_ENTRY_NAME = '[DEFAULT]';
3120
3120
  /**
3121
3121
  * Returns a {@link FirebasePerformance} instance for the given app.
3122
- * @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.044a8d7f9/firebase-app.js#FirebaseApp} to use.
3122
+ * @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js#FirebaseApp} to use.
3123
3123
  * @public
3124
3124
  */
3125
3125
  function getPerformance(app = getApp()) {
@@ -3130,7 +3130,7 @@ function getPerformance(app = getApp()) {
3130
3130
  }
3131
3131
  /**
3132
3132
  * Returns a {@link FirebasePerformance} instance for the given app. Can only be called once.
3133
- * @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.044a8d7f9/firebase-app.js#FirebaseApp} to use.
3133
+ * @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js#FirebaseApp} to use.
3134
3134
  * @param settings - Optional settings for the {@link FirebasePerformance} instance.
3135
3135
  * @public
3136
3136
  */
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).firebase,t.firebase.INTERNAL.modularAPIs)}(this,function(xt,$t){"use strict";try{!(function(){function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var l,e,r=t(xt);function g(){return"object"==typeof indexedDB}class c extends Error{constructor(t,e,r){super(e),this.code=t,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,c.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,i.prototype.create)}}class i{constructor(t,e,r){this.service=t,this.serviceName=e,this.errors=r}create(t,...e){var i,r=e[0]||{},n=`${this.service}/${t}`,a=this.errors[t],a=a?(i=r,a.replace(s,(t,e)=>{var r=i[e];return null!=r?String(r):`<${e}?>`})):"Error",a=`${this.serviceName}: ${a} (${n}).`;return new c(n,a,r)}}const s=/\{\$([^}]+)}/g;function a(t){return t&&t._delegate?t._delegate:t}class n{constructor(t,e,r){this.name=t,this.instanceFactory=e,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}(e=l=l||{})[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT";const o={debug:l.DEBUG,verbose:l.VERBOSE,info:l.INFO,warn:l.WARN,error:l.ERROR,silent:l.SILENT},u=l.INFO,h={[l.DEBUG]:"log",[l.VERBOSE]:"log",[l.INFO]:"info",[l.WARN]:"warn",[l.ERROR]:"error"},f=(t,e,...r)=>{if(!(e<t.logLevel)){var i=(new Date).toISOString(),n=h[e];if(!n)throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);console[n](`[${i}] ${t.name}:`,...r)}};class d{constructor(t){this.name=t,this._logLevel=u,this._logHandler=f,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in l))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?o[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,l.DEBUG,...t),this._logHandler(this,l.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,l.VERBOSE,...t),this._logHandler(this,l.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,l.INFO,...t),this._logHandler(this,l.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,l.WARN,...t),this._logHandler(this,l.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,l.ERROR,...t),this._logHandler(this,l.ERROR,...t)}}function p(r){return new Promise(function(t,e){r.onsuccess=function(){t(r.result)},r.onerror=function(){e(r.error)}})}function m(r,i,n){var a,t=new Promise(function(t,e){p(a=r[i].apply(r,n)).then(t,e)});return t.request=a,t}function w(t,r,e){e.forEach(function(e){Object.defineProperty(t.prototype,e,{get:function(){return this[r][e]},set:function(t){this[r][e]=t}})})}function v(e,r,i,t){t.forEach(function(t){t in i.prototype&&(e.prototype[t]=function(){return m(this[r],t,arguments)})})}function _(e,r,i,t){t.forEach(function(t){t in i.prototype&&(e.prototype[t]=function(){return this[r][t].apply(this[r],arguments)})})}function y(t,i,e,r){r.forEach(function(r){r in e.prototype&&(t.prototype[r]=function(){return t=this[i],(e=m(t,r,arguments)).then(function(t){if(t)return new S(t,e.request)});var t,e})})}function b(t){this._index=t}function S(t,e){this._cursor=t,this._request=e}function C(t){this._store=t}function E(r){this._tx=r,this.complete=new Promise(function(t,e){r.oncomplete=function(){t()},r.onerror=function(){e(r.error)},r.onabort=function(){e(r.error)}})}function I(t,e,r){this._db=t,this.oldVersion=e,this.transaction=new E(r)}function T(t){this._db=t}w(b,"_index",["name","keyPath","multiEntry","unique"]),v(b,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),y(b,"_index",IDBIndex,["openCursor","openKeyCursor"]),w(S,"_cursor",["direction","key","primaryKey","value"]),v(S,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(r){r in IDBCursor.prototype&&(S.prototype[r]=function(){var e=this,t=arguments;return Promise.resolve().then(function(){return e._cursor[r].apply(e._cursor,t),p(e._request).then(function(t){if(t)return new S(t,e._request)})})})}),C.prototype.createIndex=function(){return new b(this._store.createIndex.apply(this._store,arguments))},C.prototype.index=function(){return new b(this._store.index.apply(this._store,arguments))},w(C,"_store",["name","keyPath","indexNames","autoIncrement"]),v(C,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),y(C,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),_(C,"_store",IDBObjectStore,["deleteIndex"]),E.prototype.objectStore=function(){return new C(this._tx.objectStore.apply(this._tx,arguments))},w(E,"_tx",["objectStoreNames","mode"]),_(E,"_tx",IDBTransaction,["abort"]),I.prototype.createObjectStore=function(){return new C(this._db.createObjectStore.apply(this._db,arguments))},w(I,"_db",["name","version","objectStoreNames"]),_(I,"_db",IDBDatabase,["deleteObjectStore","close"]),T.prototype.transaction=function(){return new E(this._db.transaction.apply(this._db,arguments))},w(T,"_db",["name","version","objectStoreNames"]),_(T,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(a){[C,b].forEach(function(t){a in t.prototype&&(t.prototype[a.replace("open","iterate")]=function(){var t,e=(t=arguments,Array.prototype.slice.call(t)),r=e[e.length-1],i=this._store||this._index,n=i[a].apply(i,e.slice(0,-1));n.onsuccess=function(){r(n.result)}})})}),[b,C].forEach(function(t){t.prototype.getAll||(t.prototype.getAll=function(t,r){var i=this,n=[];return new Promise(function(e){i.iterateCursor(t,function(t){t?(n.push(t.value),void 0===r||n.length!=r?t.continue():e(n)):e(n)})})})});var L="@firebase/installations",P="0.5.5-canary.044a8d7f9";const M=1e4,F=`w:${P}`,O="FIS_v2",k="https://firebaseinstallations.googleapis.com/v1",j=36e5;var D;const N=new i("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function A(t){return t instanceof c&&t.code.includes("request-failed")}function R({projectId:t}){return`${k}/projects/${t}/installations`}function x(t){return{token:t.token,requestStatus:2,expiresIn:(t=t.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()}}async function $(t,e){var r=(await e.json()).error;return N.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function B({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function q(t,{refreshToken:e}){const r=B(t);return r.append("Authorization",(e=e,`${O} ${e}`)),r}async function H(t){var e=await t();return 500<=e.status&&e.status<600?t():e}function K(e){return new Promise(t=>{setTimeout(t,e)})}const V=/^[cdef][\w-]{21}$/,U="";function z(){try{const e=new Uint8Array(17),r=self.crypto||self.msCrypto;r.getRandomValues(e),e[0]=112+e[0]%16;var t=function(t){const e=function(t){const e=btoa(String.fromCharCode(...t));return e.replace(/\+/g,"-").replace(/\//g,"_")}(t);return e.substr(0,22)}(e);return V.test(t)?t:U}catch(t){return U}}function G(t){return`${t.appName}!${t.appId}`}const W=new Map;function J(t,e){var r=G(t);Y(r,e),function(t,e){const r=function(){!Z&&"BroadcastChannel"in self&&(Z=new BroadcastChannel("[Firebase] FID Change"),Z.onmessage=t=>{Y(t.data.key,t.data.fid)});return Z}();r&&r.postMessage({key:t,fid:e});0===W.size&&Z&&(Z.close(),Z=null)}(r,e)}function Y(t,e){var r=W.get(t);if(r)for(const i of r)i(e)}let Z=null;const Q="firebase-installations-store";let X=null;function tt(){var e,t,r;return X=X||(e=t=>{0===t.oldVersion&&t.createObjectStore(Q)},t=m(indexedDB,"open",["firebase-installations-database",1]),(r=t.request)&&(r.onupgradeneeded=function(t){e&&e(new I(r.result,t.oldVersion,r.transaction))}),t.then(function(t){return new T(t)})),X}async function et(t,e){var r=G(t);const i=await tt(),n=i.transaction(Q,"readwrite"),a=n.objectStore(Q);var s=await a.get(r);return await a.put(e,r),await n.complete,s&&s.fid===e.fid||J(t,e.fid),e}async function rt(t){var e=G(t);const r=await tt(),i=r.transaction(Q,"readwrite");await i.objectStore(Q).delete(e),await i.complete}async function it(t,e){var r=G(t);const i=await tt(),n=i.transaction(Q,"readwrite"),a=n.objectStore(Q);var s=await a.get(r),o=e(s);return void 0===o?await a.delete(r):await a.put(o,r),await n.complete,!o||s&&s.fid===o.fid||J(t,o.fid),o}async function nt(r){let i;var t=await it(r,t=>{var e=st(t||{fid:z(),registrationStatus:0}),e=function(t,e){{if(0!==e.registrationStatus)return 1===e.registrationStatus?{installationEntry:e,registrationPromise:async function(t){let e=await at(t);for(;1===e.registrationStatus;)await K(100),e=await at(t);if(0!==e.registrationStatus)return e;{var{installationEntry:r,registrationPromise:i}=await nt(t);return i||r}}(t)}:{installationEntry:e};if(!navigator.onLine){var r=Promise.reject(N.create("app-offline"));return{installationEntry:e,registrationPromise:r}}var i={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},r=async function(e,r){try{var t=await async function(t,{fid:e}){const r=R(t);var i=B(t),n={fid:e,authVersion:O,appId:t.appId,sdkVersion:F};const a={method:"POST",headers:i,body:JSON.stringify(n)},s=await H(()=>fetch(r,a));if(s.ok){n=await s.json();return{fid:n.fid||e,registrationStatus:2,refreshToken:n.refreshToken,authToken:x(n.authToken)}}throw await $("Create Installation",s)}(e,r);return et(e,t)}catch(t){throw A(t)&&409===t.customData.serverCode?await rt(e):await et(e,{fid:r.fid,registrationStatus:0}),t}}(t,i);return{installationEntry:i,registrationPromise:r}}}(r,e);return i=e.registrationPromise,e.installationEntry});return t.fid===U?{installationEntry:await i}:{installationEntry:t,registrationPromise:i}}function at(t){return it(t,t=>{if(!t)throw N.create("installation-not-found");return st(t)})}function st(t){return 1===(e=t).registrationStatus&&e.registrationTime+M<Date.now()?{fid:t.fid,registrationStatus:0}:t;var e}async function ot({appConfig:t,platformLoggerProvider:e},r){const i=([n,a]=[t,r["fid"]],`${R(n)}/${a}/authTokens:generate`);var n,a;const s=q(t,r),o=e.getImmediate({optional:!0});o&&s.append("x-firebase-client",o.getPlatformInfoString());var c={installation:{sdkVersion:F}};const u={method:"POST",headers:s,body:JSON.stringify(c)},l=await H(()=>fetch(i,u));if(l.ok)return x(await l.json());throw await $("Generate Auth Token",l)}async function ct(i,n=!1){let a;var t=await it(i.appConfig,t=>{if(!lt(t))throw N.create("not-registered");var e,r=t.authToken;if(n||2!==(e=r).requestStatus||function(t){var e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+j}(e)){if(1===r.requestStatus)return a=async function(t,e){let r=await ut(t.appConfig);for(;1===r.authToken.requestStatus;)await K(100),r=await ut(t.appConfig);var i=r.authToken;return 0===i.requestStatus?ct(t,e):i}(i,n),t;if(!navigator.onLine)throw N.create("app-offline");r=(e=t,r={requestStatus:1,requestTime:Date.now()},Object.assign(Object.assign({},e),{authToken:r}));return a=async function(e,r){try{var i=await ot(e,r),t=Object.assign(Object.assign({},r),{authToken:i});return await et(e.appConfig,t),i}catch(t){throw!A(t)||401!==t.customData.serverCode&&404!==t.customData.serverCode?(i=Object.assign(Object.assign({},r),{authToken:{requestStatus:0}}),await et(e.appConfig,i)):await rt(e.appConfig),t}}(i,r),r}return t});return a?await a:t.authToken}function ut(t){return it(t,t=>{if(!lt(t))throw N.create("not-registered");var e,r=t.authToken;return 1===(e=r).requestStatus&&e.requestTime+M<Date.now()?Object.assign(Object.assign({},t),{authToken:{requestStatus:0}}):t})}function lt(t){return void 0!==t&&2===t.registrationStatus}async function gt(t,e=!1){var r,i=t;return t=i.appConfig,await((r=(await nt(t)).registrationPromise)&&await r),(await ct(i,e)).token}function ht(t){return N.create("missing-app-config-values",{valueName:t})}const ft="installations",dt=t=>{var e=t.getProvider("app").getImmediate();return{app:e,appConfig:function(t){if(!t||!t.options)throw ht("App Configuration");if(!t.name)throw ht("App Name");for(const e of["projectId","apiKey","appId"])if(!t.options[e])throw ht(e);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e),platformLoggerProvider:$t._getProvider(e,"platform-logger"),_delete:()=>Promise.resolve()}},pt=t=>{var e=t.getProvider("app").getImmediate();const r=$t._getProvider(e,ft).getImmediate();return{getId:()=>async function(t){var e=t;const{installationEntry:r,registrationPromise:i}=await nt(e.appConfig);return(i||ct(e)).catch(console.error),r.fid}(r),getToken:t=>gt(r,t)}};$t._registerComponent(new n(ft,dt,"PUBLIC")),$t._registerComponent(new n("installations-internal",pt,"PRIVATE")),$t.registerVersion(L,P),$t.registerVersion(L,P,"esm2017");const mt="@firebase/remote-config",wt="0.3.4-canary.044a8d7f9";class vt{constructor(){this.listeners=[]}addEventListener(t){this.listeners.push(t)}abort(){this.listeners.forEach(t=>t())}}const _t=new i("remoteconfig","Remote Config",{"registration-window":"Undefined window object. This SDK only supports usage in a browser environment.","registration-project-id":"Undefined project identifier. Check Firebase app initialization.","registration-api-key":"Undefined API key. Check Firebase app initialization.","registration-app-id":"Undefined app identifier. Check Firebase app initialization.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","storage-delete":"Error thrown when deleting from storage. Original error: {$originalErrorMessage}.","fetch-client-network":"Fetch client failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-timeout":'The config fetch request timed out. Configure timeout using "fetchTimeoutMillis" SDK setting.',"fetch-throttle":'The config fetch request timed out while in an exponential backoff state. Configure timeout using "fetchTimeoutMillis" SDK setting. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',"fetch-client-parse":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","indexed-db-unavailable":"Indexed DB is not supported by current browser"});const yt=["1","true","t","yes","y","on"];class bt{constructor(t,e=""){this._source=t,this._value=e}asString(){return this._value}asBoolean(){return"static"!==this._source&&0<=yt.indexOf(this._value.toLowerCase())}asNumber(){if("static"===this._source)return 0;let t=Number(this._value);return isNaN(t)&&(t=0),t}getSource(){return this._source}}async function St(t){const e=a(t);var[r,i]=await Promise.all([e._storage.getLastSuccessfulFetchResponse(),e._storage.getActiveConfigEtag()]);return!!(r&&r.config&&r.eTag&&r.eTag!==i)&&(await Promise.all([e._storageCache.setActiveConfig(r.config),e._storage.setActiveConfigEtag(r.eTag)]),!0)}function Ct(t){const e=a(t);return e._initializePromise||(e._initializePromise=e._storageCache.loadFromStorage().then(()=>{e._isInitializationComplete=!0})),e._initializePromise}async function Et(e){const r=a(e),t=new vt;setTimeout(async()=>{t.abort()},r.settings.fetchTimeoutMillis);try{await r._client.fetch({cacheMaxAgeMillis:r.settings.minimumFetchIntervalMillis,signal:t}),await r._storageCache.setLastFetchStatus("success")}catch(t){var i=(n="fetch-throttle",(e=t)instanceof c&&-1!==e.code.indexOf(n)?"throttle":"failure");throw await r._storageCache.setLastFetchStatus(i),t}var n}function It(r){const t=a(r);return[e={},i={}]=[t._storageCache.getActiveConfig(),t.defaultConfig],Object.keys(Object.assign(Object.assign({},e),i)).reduce((t,e)=>(t[e]=Tt(r,e),t),{});var e,i}function Tt(t,e){const r=a(t);r._isInitializationComplete||r._logger.debug(`A value was requested for key "${e}" before SDK initialization completed.`+" Await on ensureInitialized if the intent was to get a previously activated value.");var i=r._storageCache.getActiveConfig();return i&&void 0!==i[e]?new bt("remote",i[e]):r.defaultConfig&&void 0!==r.defaultConfig[e]?new bt("default",String(r.defaultConfig[e])):(r._logger.debug(`Returning static value for key "${e}".`+" Define a default or remote value if this is unintentional."),new bt("static"))}class Lt{constructor(t,e,r,i){this.client=t,this.storage=e,this.storageCache=r,this.logger=i}isCachedDataFresh(t,e){if(!e)return this.logger.debug("Config fetch cache check. Cache unpopulated."),!1;var r=Date.now()-e,i=r<=t;return this.logger.debug("Config fetch cache check."+` Cache age millis: ${r}.`+` Cache max age millis (minimumFetchIntervalMillis setting): ${t}.`+` Is cache hit: ${i}.`),i}async fetch(t){var[e,r]=await Promise.all([this.storage.getLastSuccessfulFetchTimestampMillis(),this.storage.getLastSuccessfulFetchResponse()]);if(r&&this.isCachedDataFresh(t.cacheMaxAgeMillis,e))return r;t.eTag=r&&r.eTag;r=await this.client.fetch(t);const i=[this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())];return 200===r.status&&i.push(this.storage.setLastSuccessfulFetchResponse(r)),await Promise.all(i),r}}class Pt{constructor(t,e,r,i,n,a){this.firebaseInstallations=t,this.sdkVersion=e,this.namespace=r,this.projectId=i,this.apiKey=n,this.appId=a}async fetch(r){var t,[e,i]=await Promise.all([this.firebaseInstallations.getId(),this.firebaseInstallations.getToken()]),n=`${window.FIREBASE_REMOTE_CONFIG_URL_BASE||"https://firebaseremoteconfig.googleapis.com"}/v1/projects/${this.projectId}/namespaces/${this.namespace}:fetch?key=${this.apiKey}`,a={"Content-Type":"application/json","Content-Encoding":"gzip","If-None-Match":r.eTag||"*"},i={sdk_version:this.sdkVersion,app_instance_id:e,app_instance_id_token:i,app_id:this.appId,language_code:(t=navigator).languages&&t.languages[0]||t.language},i={method:"POST",headers:a,body:JSON.stringify(i)},n=fetch(n,i),i=new Promise((t,e)=>{r.signal.addEventListener(()=>{const t=new Error("The operation was aborted.");t.name="AbortError",e(t)})});let s;try{await Promise.race([n,i]),s=await n}catch(t){let e="fetch-client-network";throw"AbortError"===t.name&&(e="fetch-timeout"),_t.create(e,{originalErrorMessage:t.message})}let o=s.status;n=s.headers.get("ETag")||void 0;let c,u;if(200===s.status){let t;try{t=await s.json()}catch(t){throw _t.create("fetch-client-parse",{originalErrorMessage:t.message})}c=t.entries,u=t.state}if("INSTANCE_STATE_UNSPECIFIED"===u?o=500:"NO_CHANGE"===u?o=304:"NO_TEMPLATE"!==u&&"EMPTY_CONFIG"!==u||(c={}),304!==o&&200!==o)throw _t.create("fetch-status",{httpStatus:o});return{status:o,eTag:n,config:c}}}class Mt{constructor(t,e){this.client=t,this.storage=e}async fetch(t){var e=await this.storage.getThrottleMetadata()||{backoffCount:0,throttleEndTimeMillis:Date.now()};return this.attemptFetch(t,e)}async attemptFetch(e,{throttleEndTimeMillis:r,backoffCount:i}){var n,a;n=e.signal,a=r,await new Promise((t,e)=>{var r=Math.max(a-Date.now(),0);const i=setTimeout(t,r);n.addEventListener(()=>{clearTimeout(i),e(_t.create("fetch-throttle",{throttleEndTimeMillis:a}))})});try{var s=await this.client.fetch(e);return await this.storage.deleteThrottleMetadata(),s}catch(t){if(!function(t){if(t instanceof c&&t.customData){var e=Number(t.customData.httpStatus);return 429===e||500===e||503===e||504===e}}(t))throw t;var o={throttleEndTimeMillis:Date.now()+(r=2,s=1e3*Math.pow(r,i),o=Math.round(.5*s*(Math.random()-.5)*2),Math.min(144e5,s+o)),backoffCount:i+1};return await this.storage.setThrottleMetadata(o),this.attemptFetch(e,o)}}}class Ft{constructor(t,e,r,i,n){this.app=t,this._client=e,this._storageCache=r,this._storage=i,this._logger=n,this._isInitializationComplete=!1,this.settings={fetchTimeoutMillis:6e4,minimumFetchIntervalMillis:432e5},this.defaultConfig={}}get fetchTimeMillis(){return this._storageCache.getLastSuccessfulFetchTimestampMillis()||-1}get lastFetchStatus(){return this._storageCache.getLastFetchStatus()||"no-fetch-yet"}}function Ot(t,e){var r=t.target.error||void 0;return _t.create(e,{originalErrorMessage:r&&r.message})}const kt="app_namespace_store";class jt{constructor(t,e,r,i=function(){return new Promise((e,r)=>{try{const t=indexedDB.open("firebase_remote_config",1);t.onerror=t=>{r(Ot(t,"storage-open"))},t.onsuccess=t=>{e(t.target.result)},t.onupgradeneeded=t=>{const e=t.target.result;0===t.oldVersion&&e.createObjectStore(kt,{keyPath:"compositeKey"})}}catch(t){r(_t.create("storage-open",{originalErrorMessage:t}))}})}()){this.appId=t,this.appName=e,this.namespace=r,this.openDbPromise=i}getLastFetchStatus(){return this.get("last_fetch_status")}setLastFetchStatus(t){return this.set("last_fetch_status",t)}getLastSuccessfulFetchTimestampMillis(){return this.get("last_successful_fetch_timestamp_millis")}setLastSuccessfulFetchTimestampMillis(t){return this.set("last_successful_fetch_timestamp_millis",t)}getLastSuccessfulFetchResponse(){return this.get("last_successful_fetch_response")}setLastSuccessfulFetchResponse(t){return this.set("last_successful_fetch_response",t)}getActiveConfig(){return this.get("active_config")}setActiveConfig(t){return this.set("active_config",t)}getActiveConfigEtag(){return this.get("active_config_etag")}setActiveConfigEtag(t){return this.set("active_config_etag",t)}getThrottleMetadata(){return this.get("throttle_metadata")}setThrottleMetadata(t){return this.set("throttle_metadata",t)}deleteThrottleMetadata(){return this.delete("throttle_metadata")}async get(s){const o=await this.openDbPromise;return new Promise((r,e)=>{const t=o.transaction([kt],"readonly"),i=t.objectStore(kt);var n=this.createCompositeKey(s);try{const a=i.get(n);a.onerror=t=>{e(Ot(t,"storage-get"))},a.onsuccess=t=>{var e=t.target.result;r(e?e.value:void 0)}}catch(t){e(_t.create("storage-get",{originalErrorMessage:t&&t.message}))}})}async set(s,o){const c=await this.openDbPromise;return new Promise((t,e)=>{const r=c.transaction([kt],"readwrite"),i=r.objectStore(kt);var n=this.createCompositeKey(s);try{const a=i.put({compositeKey:n,value:o});a.onerror=t=>{e(Ot(t,"storage-set"))},a.onsuccess=()=>{t()}}catch(t){e(_t.create("storage-set",{originalErrorMessage:t&&t.message}))}})}async delete(s){const o=await this.openDbPromise;return new Promise((t,e)=>{const r=o.transaction([kt],"readwrite"),i=r.objectStore(kt);var n=this.createCompositeKey(s);try{const a=i.delete(n);a.onerror=t=>{e(Ot(t,"storage-delete"))},a.onsuccess=()=>{t()}}catch(t){e(_t.create("storage-delete",{originalErrorMessage:t&&t.message}))}})}createCompositeKey(t){return[this.appId,this.appName,this.namespace,t].join()}}class Dt{constructor(t){this.storage=t}getLastFetchStatus(){return this.lastFetchStatus}getLastSuccessfulFetchTimestampMillis(){return this.lastSuccessfulFetchTimestampMillis}getActiveConfig(){return this.activeConfig}async loadFromStorage(){var t=this.storage.getLastFetchStatus(),e=this.storage.getLastSuccessfulFetchTimestampMillis(),r=this.storage.getActiveConfig(),t=await t;t&&(this.lastFetchStatus=t);e=await e;e&&(this.lastSuccessfulFetchTimestampMillis=e);r=await r;r&&(this.activeConfig=r)}setLastFetchStatus(t){return this.lastFetchStatus=t,this.storage.setLastFetchStatus(t)}setLastSuccessfulFetchTimestampMillis(t){return this.lastSuccessfulFetchTimestampMillis=t,this.storage.setLastSuccessfulFetchTimestampMillis(t)}setActiveConfig(t){return this.activeConfig=t,this.storage.setActiveConfig(t)}}async function Nt(){if(!g())return!1;try{return await new Promise((e,r)=>{try{let t=!0;const i="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(i);n.onsuccess=()=>{n.result.close(),t||self.indexedDB.deleteDatabase(i),e(!0)},n.onupgradeneeded=()=>{t=!1},n.onerror=()=>{var t;r((null===(t=n.error)||void 0===t?void 0:t.message)||"")}}catch(t){r(t)}})}catch(t){return!1}}$t._registerComponent(new n("remote-config",function(t,{instanceIdentifier:e}){var r=t.getProvider("app").getImmediate(),i=t.getProvider("installations-internal").getImmediate();if("undefined"==typeof window)throw _t.create("registration-window");if(!g())throw _t.create("indexed-db-unavailable");var{projectId:n,apiKey:a,appId:s}=r.options;if(!n)throw _t.create("registration-project-id");if(!a)throw _t.create("registration-api-key");if(!s)throw _t.create("registration-app-id");e=e||"firebase";const o=new jt(s,r.name,e),c=new Dt(o),u=new d(mt);u.logLevel=l.ERROR;s=new Pt(i,$t.SDK_VERSION,e,n,a,s),s=new Mt(s,o),s=new Lt(s,o,c,u),s=new Ft(r,s,c,o,u);return Ct(s),s},"PUBLIC").setMultipleInstances(!0)),$t.registerVersion(mt,wt),$t.registerVersion(mt,wt,"esm2017");class At{constructor(t,e){this.app=t,this._delegate=e}get defaultConfig(){return this._delegate.defaultConfig}set defaultConfig(t){this._delegate.defaultConfig=t}get fetchTimeMillis(){return this._delegate.fetchTimeMillis}get lastFetchStatus(){return this._delegate.lastFetchStatus}get settings(){return this._delegate.settings}set settings(t){this._delegate.settings=t}activate(){return St(this._delegate)}ensureInitialized(){return Ct(this._delegate)}fetch(){return Et(this._delegate)}fetchAndActivate(){return async function(t){return await Et(t=a(t)),St(t)}(this._delegate)}getAll(){return It(this._delegate)}getBoolean(t){return Tt(a(this._delegate),t).asBoolean()}getNumber(t){return Tt(a(this._delegate),t).asNumber()}getString(t){return Tt(a(this._delegate),t).asString()}getValue(t){return Tt(this._delegate,t)}setLogLevel(t){!function(t,e){const r=a(t);switch(e){case"debug":r._logger.logLevel=l.DEBUG;break;case"silent":r._logger.logLevel=l.SILENT;break;default:r._logger.logLevel=l.ERROR}}(this._delegate,t)}}function Rt(t,{instanceIdentifier:e}){var r=t.getProvider("app-compat").getImmediate(),i=t.getProvider("remote-config").getImmediate({identifier:e});return new At(r,i)}(D=r.default).INTERNAL.registerComponent(new n("remoteConfig-compat",Rt,"PUBLIC").setMultipleInstances(!0).setServiceProps({isSupported:Nt})),D.registerVersion("@firebase/remote-config-compat","0.1.5-canary.044a8d7f9")}).apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-remote-config-compat.js - be sure to load firebase-app.js first.")}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).firebase,t.firebase.INTERNAL.modularAPIs)}(this,function(xt,$t){"use strict";try{!(function(){function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var l,e,r=t(xt);function g(){return"object"==typeof indexedDB}class c extends Error{constructor(t,e,r){super(e),this.code=t,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,c.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,i.prototype.create)}}class i{constructor(t,e,r){this.service=t,this.serviceName=e,this.errors=r}create(t,...e){var i,r=e[0]||{},n=`${this.service}/${t}`,a=this.errors[t],a=a?(i=r,a.replace(s,(t,e)=>{var r=i[e];return null!=r?String(r):`<${e}?>`})):"Error",a=`${this.serviceName}: ${a} (${n}).`;return new c(n,a,r)}}const s=/\{\$([^}]+)}/g;function a(t){return t&&t._delegate?t._delegate:t}class n{constructor(t,e,r){this.name=t,this.instanceFactory=e,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}(e=l=l||{})[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT";const o={debug:l.DEBUG,verbose:l.VERBOSE,info:l.INFO,warn:l.WARN,error:l.ERROR,silent:l.SILENT},u=l.INFO,h={[l.DEBUG]:"log",[l.VERBOSE]:"log",[l.INFO]:"info",[l.WARN]:"warn",[l.ERROR]:"error"},f=(t,e,...r)=>{if(!(e<t.logLevel)){var i=(new Date).toISOString(),n=h[e];if(!n)throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`);console[n](`[${i}] ${t.name}:`,...r)}};class d{constructor(t){this.name=t,this._logLevel=u,this._logHandler=f,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in l))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?o[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,l.DEBUG,...t),this._logHandler(this,l.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,l.VERBOSE,...t),this._logHandler(this,l.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,l.INFO,...t),this._logHandler(this,l.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,l.WARN,...t),this._logHandler(this,l.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,l.ERROR,...t),this._logHandler(this,l.ERROR,...t)}}function p(r){return new Promise(function(t,e){r.onsuccess=function(){t(r.result)},r.onerror=function(){e(r.error)}})}function m(r,i,n){var a,t=new Promise(function(t,e){p(a=r[i].apply(r,n)).then(t,e)});return t.request=a,t}function w(t,r,e){e.forEach(function(e){Object.defineProperty(t.prototype,e,{get:function(){return this[r][e]},set:function(t){this[r][e]=t}})})}function v(e,r,i,t){t.forEach(function(t){t in i.prototype&&(e.prototype[t]=function(){return m(this[r],t,arguments)})})}function _(e,r,i,t){t.forEach(function(t){t in i.prototype&&(e.prototype[t]=function(){return this[r][t].apply(this[r],arguments)})})}function y(t,i,e,r){r.forEach(function(r){r in e.prototype&&(t.prototype[r]=function(){return t=this[i],(e=m(t,r,arguments)).then(function(t){if(t)return new S(t,e.request)});var t,e})})}function b(t){this._index=t}function S(t,e){this._cursor=t,this._request=e}function C(t){this._store=t}function E(r){this._tx=r,this.complete=new Promise(function(t,e){r.oncomplete=function(){t()},r.onerror=function(){e(r.error)},r.onabort=function(){e(r.error)}})}function I(t,e,r){this._db=t,this.oldVersion=e,this.transaction=new E(r)}function T(t){this._db=t}w(b,"_index",["name","keyPath","multiEntry","unique"]),v(b,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),y(b,"_index",IDBIndex,["openCursor","openKeyCursor"]),w(S,"_cursor",["direction","key","primaryKey","value"]),v(S,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(r){r in IDBCursor.prototype&&(S.prototype[r]=function(){var e=this,t=arguments;return Promise.resolve().then(function(){return e._cursor[r].apply(e._cursor,t),p(e._request).then(function(t){if(t)return new S(t,e._request)})})})}),C.prototype.createIndex=function(){return new b(this._store.createIndex.apply(this._store,arguments))},C.prototype.index=function(){return new b(this._store.index.apply(this._store,arguments))},w(C,"_store",["name","keyPath","indexNames","autoIncrement"]),v(C,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),y(C,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),_(C,"_store",IDBObjectStore,["deleteIndex"]),E.prototype.objectStore=function(){return new C(this._tx.objectStore.apply(this._tx,arguments))},w(E,"_tx",["objectStoreNames","mode"]),_(E,"_tx",IDBTransaction,["abort"]),I.prototype.createObjectStore=function(){return new C(this._db.createObjectStore.apply(this._db,arguments))},w(I,"_db",["name","version","objectStoreNames"]),_(I,"_db",IDBDatabase,["deleteObjectStore","close"]),T.prototype.transaction=function(){return new E(this._db.transaction.apply(this._db,arguments))},w(T,"_db",["name","version","objectStoreNames"]),_(T,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(a){[C,b].forEach(function(t){a in t.prototype&&(t.prototype[a.replace("open","iterate")]=function(){var t,e=(t=arguments,Array.prototype.slice.call(t)),r=e[e.length-1],i=this._store||this._index,n=i[a].apply(i,e.slice(0,-1));n.onsuccess=function(){r(n.result)}})})}),[b,C].forEach(function(t){t.prototype.getAll||(t.prototype.getAll=function(t,r){var i=this,n=[];return new Promise(function(e){i.iterateCursor(t,function(t){t?(n.push(t.value),void 0===r||n.length!=r?t.continue():e(n)):e(n)})})})});var L="@firebase/installations",P="0.5.5-canary.88d43ec00";const M=1e4,F=`w:${P}`,O="FIS_v2",k="https://firebaseinstallations.googleapis.com/v1",j=36e5;var D;const N=new i("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function A(t){return t instanceof c&&t.code.includes("request-failed")}function R({projectId:t}){return`${k}/projects/${t}/installations`}function x(t){return{token:t.token,requestStatus:2,expiresIn:(t=t.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()}}async function $(t,e){var r=(await e.json()).error;return N.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function B({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function q(t,{refreshToken:e}){const r=B(t);return r.append("Authorization",(e=e,`${O} ${e}`)),r}async function H(t){var e=await t();return 500<=e.status&&e.status<600?t():e}function K(e){return new Promise(t=>{setTimeout(t,e)})}const V=/^[cdef][\w-]{21}$/,U="";function z(){try{const e=new Uint8Array(17),r=self.crypto||self.msCrypto;r.getRandomValues(e),e[0]=112+e[0]%16;var t=function(t){const e=function(t){const e=btoa(String.fromCharCode(...t));return e.replace(/\+/g,"-").replace(/\//g,"_")}(t);return e.substr(0,22)}(e);return V.test(t)?t:U}catch(t){return U}}function G(t){return`${t.appName}!${t.appId}`}const W=new Map;function J(t,e){var r=G(t);Y(r,e),function(t,e){const r=function(){!Z&&"BroadcastChannel"in self&&(Z=new BroadcastChannel("[Firebase] FID Change"),Z.onmessage=t=>{Y(t.data.key,t.data.fid)});return Z}();r&&r.postMessage({key:t,fid:e});0===W.size&&Z&&(Z.close(),Z=null)}(r,e)}function Y(t,e){var r=W.get(t);if(r)for(const i of r)i(e)}let Z=null;const Q="firebase-installations-store";let X=null;function tt(){var e,t,r;return X=X||(e=t=>{0===t.oldVersion&&t.createObjectStore(Q)},t=m(indexedDB,"open",["firebase-installations-database",1]),(r=t.request)&&(r.onupgradeneeded=function(t){e&&e(new I(r.result,t.oldVersion,r.transaction))}),t.then(function(t){return new T(t)})),X}async function et(t,e){var r=G(t);const i=await tt(),n=i.transaction(Q,"readwrite"),a=n.objectStore(Q);var s=await a.get(r);return await a.put(e,r),await n.complete,s&&s.fid===e.fid||J(t,e.fid),e}async function rt(t){var e=G(t);const r=await tt(),i=r.transaction(Q,"readwrite");await i.objectStore(Q).delete(e),await i.complete}async function it(t,e){var r=G(t);const i=await tt(),n=i.transaction(Q,"readwrite"),a=n.objectStore(Q);var s=await a.get(r),o=e(s);return void 0===o?await a.delete(r):await a.put(o,r),await n.complete,!o||s&&s.fid===o.fid||J(t,o.fid),o}async function nt(r){let i;var t=await it(r,t=>{var e=st(t||{fid:z(),registrationStatus:0}),e=function(t,e){{if(0!==e.registrationStatus)return 1===e.registrationStatus?{installationEntry:e,registrationPromise:async function(t){let e=await at(t);for(;1===e.registrationStatus;)await K(100),e=await at(t);if(0!==e.registrationStatus)return e;{var{installationEntry:r,registrationPromise:i}=await nt(t);return i||r}}(t)}:{installationEntry:e};if(!navigator.onLine){var r=Promise.reject(N.create("app-offline"));return{installationEntry:e,registrationPromise:r}}var i={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},r=async function(e,r){try{var t=await async function(t,{fid:e}){const r=R(t);var i=B(t),n={fid:e,authVersion:O,appId:t.appId,sdkVersion:F};const a={method:"POST",headers:i,body:JSON.stringify(n)},s=await H(()=>fetch(r,a));if(s.ok){n=await s.json();return{fid:n.fid||e,registrationStatus:2,refreshToken:n.refreshToken,authToken:x(n.authToken)}}throw await $("Create Installation",s)}(e,r);return et(e,t)}catch(t){throw A(t)&&409===t.customData.serverCode?await rt(e):await et(e,{fid:r.fid,registrationStatus:0}),t}}(t,i);return{installationEntry:i,registrationPromise:r}}}(r,e);return i=e.registrationPromise,e.installationEntry});return t.fid===U?{installationEntry:await i}:{installationEntry:t,registrationPromise:i}}function at(t){return it(t,t=>{if(!t)throw N.create("installation-not-found");return st(t)})}function st(t){return 1===(e=t).registrationStatus&&e.registrationTime+M<Date.now()?{fid:t.fid,registrationStatus:0}:t;var e}async function ot({appConfig:t,platformLoggerProvider:e},r){const i=([n,a]=[t,r["fid"]],`${R(n)}/${a}/authTokens:generate`);var n,a;const s=q(t,r),o=e.getImmediate({optional:!0});o&&s.append("x-firebase-client",o.getPlatformInfoString());var c={installation:{sdkVersion:F}};const u={method:"POST",headers:s,body:JSON.stringify(c)},l=await H(()=>fetch(i,u));if(l.ok)return x(await l.json());throw await $("Generate Auth Token",l)}async function ct(i,n=!1){let a;var t=await it(i.appConfig,t=>{if(!lt(t))throw N.create("not-registered");var e,r=t.authToken;if(n||2!==(e=r).requestStatus||function(t){var e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+j}(e)){if(1===r.requestStatus)return a=async function(t,e){let r=await ut(t.appConfig);for(;1===r.authToken.requestStatus;)await K(100),r=await ut(t.appConfig);var i=r.authToken;return 0===i.requestStatus?ct(t,e):i}(i,n),t;if(!navigator.onLine)throw N.create("app-offline");r=(e=t,r={requestStatus:1,requestTime:Date.now()},Object.assign(Object.assign({},e),{authToken:r}));return a=async function(e,r){try{var i=await ot(e,r),t=Object.assign(Object.assign({},r),{authToken:i});return await et(e.appConfig,t),i}catch(t){throw!A(t)||401!==t.customData.serverCode&&404!==t.customData.serverCode?(i=Object.assign(Object.assign({},r),{authToken:{requestStatus:0}}),await et(e.appConfig,i)):await rt(e.appConfig),t}}(i,r),r}return t});return a?await a:t.authToken}function ut(t){return it(t,t=>{if(!lt(t))throw N.create("not-registered");var e,r=t.authToken;return 1===(e=r).requestStatus&&e.requestTime+M<Date.now()?Object.assign(Object.assign({},t),{authToken:{requestStatus:0}}):t})}function lt(t){return void 0!==t&&2===t.registrationStatus}async function gt(t,e=!1){var r,i=t;return t=i.appConfig,await((r=(await nt(t)).registrationPromise)&&await r),(await ct(i,e)).token}function ht(t){return N.create("missing-app-config-values",{valueName:t})}const ft="installations",dt=t=>{var e=t.getProvider("app").getImmediate();return{app:e,appConfig:function(t){if(!t||!t.options)throw ht("App Configuration");if(!t.name)throw ht("App Name");for(const e of["projectId","apiKey","appId"])if(!t.options[e])throw ht(e);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e),platformLoggerProvider:$t._getProvider(e,"platform-logger"),_delete:()=>Promise.resolve()}},pt=t=>{var e=t.getProvider("app").getImmediate();const r=$t._getProvider(e,ft).getImmediate();return{getId:()=>async function(t){var e=t;const{installationEntry:r,registrationPromise:i}=await nt(e.appConfig);return(i||ct(e)).catch(console.error),r.fid}(r),getToken:t=>gt(r,t)}};$t._registerComponent(new n(ft,dt,"PUBLIC")),$t._registerComponent(new n("installations-internal",pt,"PRIVATE")),$t.registerVersion(L,P),$t.registerVersion(L,P,"esm2017");const mt="@firebase/remote-config",wt="0.3.4-canary.88d43ec00";class vt{constructor(){this.listeners=[]}addEventListener(t){this.listeners.push(t)}abort(){this.listeners.forEach(t=>t())}}const _t=new i("remoteconfig","Remote Config",{"registration-window":"Undefined window object. This SDK only supports usage in a browser environment.","registration-project-id":"Undefined project identifier. Check Firebase app initialization.","registration-api-key":"Undefined API key. Check Firebase app initialization.","registration-app-id":"Undefined app identifier. Check Firebase app initialization.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","storage-delete":"Error thrown when deleting from storage. Original error: {$originalErrorMessage}.","fetch-client-network":"Fetch client failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-timeout":'The config fetch request timed out. Configure timeout using "fetchTimeoutMillis" SDK setting.',"fetch-throttle":'The config fetch request timed out while in an exponential backoff state. Configure timeout using "fetchTimeoutMillis" SDK setting. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',"fetch-client-parse":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","indexed-db-unavailable":"Indexed DB is not supported by current browser"});const yt=["1","true","t","yes","y","on"];class bt{constructor(t,e=""){this._source=t,this._value=e}asString(){return this._value}asBoolean(){return"static"!==this._source&&0<=yt.indexOf(this._value.toLowerCase())}asNumber(){if("static"===this._source)return 0;let t=Number(this._value);return isNaN(t)&&(t=0),t}getSource(){return this._source}}async function St(t){const e=a(t);var[r,i]=await Promise.all([e._storage.getLastSuccessfulFetchResponse(),e._storage.getActiveConfigEtag()]);return!!(r&&r.config&&r.eTag&&r.eTag!==i)&&(await Promise.all([e._storageCache.setActiveConfig(r.config),e._storage.setActiveConfigEtag(r.eTag)]),!0)}function Ct(t){const e=a(t);return e._initializePromise||(e._initializePromise=e._storageCache.loadFromStorage().then(()=>{e._isInitializationComplete=!0})),e._initializePromise}async function Et(e){const r=a(e),t=new vt;setTimeout(async()=>{t.abort()},r.settings.fetchTimeoutMillis);try{await r._client.fetch({cacheMaxAgeMillis:r.settings.minimumFetchIntervalMillis,signal:t}),await r._storageCache.setLastFetchStatus("success")}catch(t){var i=(n="fetch-throttle",(e=t)instanceof c&&-1!==e.code.indexOf(n)?"throttle":"failure");throw await r._storageCache.setLastFetchStatus(i),t}var n}function It(r){const t=a(r);return[e={},i={}]=[t._storageCache.getActiveConfig(),t.defaultConfig],Object.keys(Object.assign(Object.assign({},e),i)).reduce((t,e)=>(t[e]=Tt(r,e),t),{});var e,i}function Tt(t,e){const r=a(t);r._isInitializationComplete||r._logger.debug(`A value was requested for key "${e}" before SDK initialization completed.`+" Await on ensureInitialized if the intent was to get a previously activated value.");var i=r._storageCache.getActiveConfig();return i&&void 0!==i[e]?new bt("remote",i[e]):r.defaultConfig&&void 0!==r.defaultConfig[e]?new bt("default",String(r.defaultConfig[e])):(r._logger.debug(`Returning static value for key "${e}".`+" Define a default or remote value if this is unintentional."),new bt("static"))}class Lt{constructor(t,e,r,i){this.client=t,this.storage=e,this.storageCache=r,this.logger=i}isCachedDataFresh(t,e){if(!e)return this.logger.debug("Config fetch cache check. Cache unpopulated."),!1;var r=Date.now()-e,i=r<=t;return this.logger.debug("Config fetch cache check."+` Cache age millis: ${r}.`+` Cache max age millis (minimumFetchIntervalMillis setting): ${t}.`+` Is cache hit: ${i}.`),i}async fetch(t){var[e,r]=await Promise.all([this.storage.getLastSuccessfulFetchTimestampMillis(),this.storage.getLastSuccessfulFetchResponse()]);if(r&&this.isCachedDataFresh(t.cacheMaxAgeMillis,e))return r;t.eTag=r&&r.eTag;r=await this.client.fetch(t);const i=[this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())];return 200===r.status&&i.push(this.storage.setLastSuccessfulFetchResponse(r)),await Promise.all(i),r}}class Pt{constructor(t,e,r,i,n,a){this.firebaseInstallations=t,this.sdkVersion=e,this.namespace=r,this.projectId=i,this.apiKey=n,this.appId=a}async fetch(r){var t,[e,i]=await Promise.all([this.firebaseInstallations.getId(),this.firebaseInstallations.getToken()]),n=`${window.FIREBASE_REMOTE_CONFIG_URL_BASE||"https://firebaseremoteconfig.googleapis.com"}/v1/projects/${this.projectId}/namespaces/${this.namespace}:fetch?key=${this.apiKey}`,a={"Content-Type":"application/json","Content-Encoding":"gzip","If-None-Match":r.eTag||"*"},i={sdk_version:this.sdkVersion,app_instance_id:e,app_instance_id_token:i,app_id:this.appId,language_code:(t=navigator).languages&&t.languages[0]||t.language},i={method:"POST",headers:a,body:JSON.stringify(i)},n=fetch(n,i),i=new Promise((t,e)=>{r.signal.addEventListener(()=>{const t=new Error("The operation was aborted.");t.name="AbortError",e(t)})});let s;try{await Promise.race([n,i]),s=await n}catch(t){let e="fetch-client-network";throw"AbortError"===t.name&&(e="fetch-timeout"),_t.create(e,{originalErrorMessage:t.message})}let o=s.status;n=s.headers.get("ETag")||void 0;let c,u;if(200===s.status){let t;try{t=await s.json()}catch(t){throw _t.create("fetch-client-parse",{originalErrorMessage:t.message})}c=t.entries,u=t.state}if("INSTANCE_STATE_UNSPECIFIED"===u?o=500:"NO_CHANGE"===u?o=304:"NO_TEMPLATE"!==u&&"EMPTY_CONFIG"!==u||(c={}),304!==o&&200!==o)throw _t.create("fetch-status",{httpStatus:o});return{status:o,eTag:n,config:c}}}class Mt{constructor(t,e){this.client=t,this.storage=e}async fetch(t){var e=await this.storage.getThrottleMetadata()||{backoffCount:0,throttleEndTimeMillis:Date.now()};return this.attemptFetch(t,e)}async attemptFetch(e,{throttleEndTimeMillis:r,backoffCount:i}){var n,a;n=e.signal,a=r,await new Promise((t,e)=>{var r=Math.max(a-Date.now(),0);const i=setTimeout(t,r);n.addEventListener(()=>{clearTimeout(i),e(_t.create("fetch-throttle",{throttleEndTimeMillis:a}))})});try{var s=await this.client.fetch(e);return await this.storage.deleteThrottleMetadata(),s}catch(t){if(!function(t){if(t instanceof c&&t.customData){var e=Number(t.customData.httpStatus);return 429===e||500===e||503===e||504===e}}(t))throw t;var o={throttleEndTimeMillis:Date.now()+(r=2,s=1e3*Math.pow(r,i),o=Math.round(.5*s*(Math.random()-.5)*2),Math.min(144e5,s+o)),backoffCount:i+1};return await this.storage.setThrottleMetadata(o),this.attemptFetch(e,o)}}}class Ft{constructor(t,e,r,i,n){this.app=t,this._client=e,this._storageCache=r,this._storage=i,this._logger=n,this._isInitializationComplete=!1,this.settings={fetchTimeoutMillis:6e4,minimumFetchIntervalMillis:432e5},this.defaultConfig={}}get fetchTimeMillis(){return this._storageCache.getLastSuccessfulFetchTimestampMillis()||-1}get lastFetchStatus(){return this._storageCache.getLastFetchStatus()||"no-fetch-yet"}}function Ot(t,e){var r=t.target.error||void 0;return _t.create(e,{originalErrorMessage:r&&r.message})}const kt="app_namespace_store";class jt{constructor(t,e,r,i=function(){return new Promise((e,r)=>{try{const t=indexedDB.open("firebase_remote_config",1);t.onerror=t=>{r(Ot(t,"storage-open"))},t.onsuccess=t=>{e(t.target.result)},t.onupgradeneeded=t=>{const e=t.target.result;0===t.oldVersion&&e.createObjectStore(kt,{keyPath:"compositeKey"})}}catch(t){r(_t.create("storage-open",{originalErrorMessage:t}))}})}()){this.appId=t,this.appName=e,this.namespace=r,this.openDbPromise=i}getLastFetchStatus(){return this.get("last_fetch_status")}setLastFetchStatus(t){return this.set("last_fetch_status",t)}getLastSuccessfulFetchTimestampMillis(){return this.get("last_successful_fetch_timestamp_millis")}setLastSuccessfulFetchTimestampMillis(t){return this.set("last_successful_fetch_timestamp_millis",t)}getLastSuccessfulFetchResponse(){return this.get("last_successful_fetch_response")}setLastSuccessfulFetchResponse(t){return this.set("last_successful_fetch_response",t)}getActiveConfig(){return this.get("active_config")}setActiveConfig(t){return this.set("active_config",t)}getActiveConfigEtag(){return this.get("active_config_etag")}setActiveConfigEtag(t){return this.set("active_config_etag",t)}getThrottleMetadata(){return this.get("throttle_metadata")}setThrottleMetadata(t){return this.set("throttle_metadata",t)}deleteThrottleMetadata(){return this.delete("throttle_metadata")}async get(s){const o=await this.openDbPromise;return new Promise((r,e)=>{const t=o.transaction([kt],"readonly"),i=t.objectStore(kt);var n=this.createCompositeKey(s);try{const a=i.get(n);a.onerror=t=>{e(Ot(t,"storage-get"))},a.onsuccess=t=>{var e=t.target.result;r(e?e.value:void 0)}}catch(t){e(_t.create("storage-get",{originalErrorMessage:t&&t.message}))}})}async set(s,o){const c=await this.openDbPromise;return new Promise((t,e)=>{const r=c.transaction([kt],"readwrite"),i=r.objectStore(kt);var n=this.createCompositeKey(s);try{const a=i.put({compositeKey:n,value:o});a.onerror=t=>{e(Ot(t,"storage-set"))},a.onsuccess=()=>{t()}}catch(t){e(_t.create("storage-set",{originalErrorMessage:t&&t.message}))}})}async delete(s){const o=await this.openDbPromise;return new Promise((t,e)=>{const r=o.transaction([kt],"readwrite"),i=r.objectStore(kt);var n=this.createCompositeKey(s);try{const a=i.delete(n);a.onerror=t=>{e(Ot(t,"storage-delete"))},a.onsuccess=()=>{t()}}catch(t){e(_t.create("storage-delete",{originalErrorMessage:t&&t.message}))}})}createCompositeKey(t){return[this.appId,this.appName,this.namespace,t].join()}}class Dt{constructor(t){this.storage=t}getLastFetchStatus(){return this.lastFetchStatus}getLastSuccessfulFetchTimestampMillis(){return this.lastSuccessfulFetchTimestampMillis}getActiveConfig(){return this.activeConfig}async loadFromStorage(){var t=this.storage.getLastFetchStatus(),e=this.storage.getLastSuccessfulFetchTimestampMillis(),r=this.storage.getActiveConfig(),t=await t;t&&(this.lastFetchStatus=t);e=await e;e&&(this.lastSuccessfulFetchTimestampMillis=e);r=await r;r&&(this.activeConfig=r)}setLastFetchStatus(t){return this.lastFetchStatus=t,this.storage.setLastFetchStatus(t)}setLastSuccessfulFetchTimestampMillis(t){return this.lastSuccessfulFetchTimestampMillis=t,this.storage.setLastSuccessfulFetchTimestampMillis(t)}setActiveConfig(t){return this.activeConfig=t,this.storage.setActiveConfig(t)}}async function Nt(){if(!g())return!1;try{return await new Promise((e,r)=>{try{let t=!0;const i="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(i);n.onsuccess=()=>{n.result.close(),t||self.indexedDB.deleteDatabase(i),e(!0)},n.onupgradeneeded=()=>{t=!1},n.onerror=()=>{var t;r((null===(t=n.error)||void 0===t?void 0:t.message)||"")}}catch(t){r(t)}})}catch(t){return!1}}$t._registerComponent(new n("remote-config",function(t,{instanceIdentifier:e}){var r=t.getProvider("app").getImmediate(),i=t.getProvider("installations-internal").getImmediate();if("undefined"==typeof window)throw _t.create("registration-window");if(!g())throw _t.create("indexed-db-unavailable");var{projectId:n,apiKey:a,appId:s}=r.options;if(!n)throw _t.create("registration-project-id");if(!a)throw _t.create("registration-api-key");if(!s)throw _t.create("registration-app-id");e=e||"firebase";const o=new jt(s,r.name,e),c=new Dt(o),u=new d(mt);u.logLevel=l.ERROR;s=new Pt(i,$t.SDK_VERSION,e,n,a,s),s=new Mt(s,o),s=new Lt(s,o,c,u),s=new Ft(r,s,c,o,u);return Ct(s),s},"PUBLIC").setMultipleInstances(!0)),$t.registerVersion(mt,wt),$t.registerVersion(mt,wt,"esm2017");class At{constructor(t,e){this.app=t,this._delegate=e}get defaultConfig(){return this._delegate.defaultConfig}set defaultConfig(t){this._delegate.defaultConfig=t}get fetchTimeMillis(){return this._delegate.fetchTimeMillis}get lastFetchStatus(){return this._delegate.lastFetchStatus}get settings(){return this._delegate.settings}set settings(t){this._delegate.settings=t}activate(){return St(this._delegate)}ensureInitialized(){return Ct(this._delegate)}fetch(){return Et(this._delegate)}fetchAndActivate(){return async function(t){return await Et(t=a(t)),St(t)}(this._delegate)}getAll(){return It(this._delegate)}getBoolean(t){return Tt(a(this._delegate),t).asBoolean()}getNumber(t){return Tt(a(this._delegate),t).asNumber()}getString(t){return Tt(a(this._delegate),t).asString()}getValue(t){return Tt(this._delegate,t)}setLogLevel(t){!function(t,e){const r=a(t);switch(e){case"debug":r._logger.logLevel=l.DEBUG;break;case"silent":r._logger.logLevel=l.SILENT;break;default:r._logger.logLevel=l.ERROR}}(this._delegate,t)}}function Rt(t,{instanceIdentifier:e}){var r=t.getProvider("app-compat").getImmediate(),i=t.getProvider("remote-config").getImmediate({identifier:e});return new At(r,i)}(D=r.default).INTERNAL.registerComponent(new n("remoteConfig-compat",Rt,"PUBLIC").setMultipleInstances(!0).setServiceProps({isSupported:Nt})),D.registerVersion("@firebase/remote-config-compat","0.1.5-canary.88d43ec00")}).apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-remote-config-compat.js - be sure to load firebase-app.js first.")}});
2
2
  //# sourceMappingURL=firebase-remote-config-compat.js.map
@@ -1,4 +1,4 @@
1
- import { registerVersion, _registerComponent, _getProvider, getApp, SDK_VERSION } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.044a8d7f9/firebase-app.js';
1
+ import { registerVersion, _registerComponent, _getProvider, getApp, SDK_VERSION } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js';
2
2
 
3
3
  /**
4
4
  * @license
@@ -750,7 +750,7 @@ function openDb(name, version, upgradeCallback) {
750
750
  }
751
751
 
752
752
  const name$1 = "@firebase/installations";
753
- const version$1 = "0.5.5-canary.044a8d7f9";
753
+ const version$1 = "0.5.5-canary.88d43ec00";
754
754
 
755
755
  /**
756
756
  * @license
@@ -1715,7 +1715,7 @@ registerVersion(name$1, version$1);
1715
1715
  registerVersion(name$1, version$1, 'esm2017');
1716
1716
 
1717
1717
  const name = "@firebase/remote-config";
1718
- const version = "0.3.4-canary.044a8d7f9";
1718
+ const version = "0.3.4-canary.88d43ec00";
1719
1719
 
1720
1720
  /**
1721
1721
  * @license
@@ -1881,7 +1881,7 @@ class Value {
1881
1881
  */
1882
1882
  /**
1883
1883
  *
1884
- * @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.044a8d7f9/firebase-app.js#FirebaseApp} instance.
1884
+ * @param app - The {@link https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js#FirebaseApp} instance.
1885
1885
  * @returns A {@link RemoteConfig} instance.
1886
1886
  *
1887
1887
  * @public
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,function(Je,Ze){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o,t,r,s,n=e(Je);function i(t){const r=[];let s=0;for(let n=0;n<t.length;n++){let e=t.charCodeAt(n);e<128?r[s++]=e:(e<2048?r[s++]=e>>6|192:(55296==(64512&e)&&n+1<t.length&&56320==(64512&t.charCodeAt(n+1))?(e=65536+((1023&e)<<10)+(1023&t.charCodeAt(++n)),r[s++]=e>>18|240,r[s++]=e>>12&63|128):r[s++]=e>>12|224,r[s++]=e>>6&63|128),r[s++]=63&e|128)}return r}function a(e){return l(e).replace(/\./g,"")}const h={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(r,e){if(!Array.isArray(r))throw Error("encodeByteArray takes an array as a parameter");this.init_();var s=e?this.byteToCharMapWebSafe_:this.byteToCharMap_;const n=[];for(let c=0;c<r.length;c+=3){var i=r[c],o=c+1<r.length,a=o?r[c+1]:0,h=c+2<r.length,l=h?r[c+2]:0;let e=(15&a)<<2|l>>6,t=63&l;h||(t=64,o||(e=64)),n.push(s[i>>2],s[(3&i)<<4|a>>4],s[e],s[t])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(i(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let r=0,s=0;for(;r<e.length;){var n,i,o=e[r++];o<128?t[s++]=String.fromCharCode(o):191<o&&o<224?(n=e[r++],t[s++]=String.fromCharCode((31&o)<<6|63&n)):239<o&&o<365?(i=((7&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t[s++]=String.fromCharCode(55296+(i>>10)),t[s++]=String.fromCharCode(56320+(1023&i))):(n=e[r++],i=e[r++],t[s++]=String.fromCharCode((15&o)<<12|(63&n)<<6|63&i))}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();var r=t?this.charToByteMapWebSafe_:this.charToByteMap_;const s=[];for(let h=0;h<e.length;){var n=r[e.charAt(h++)],i=h<e.length?r[e.charAt(h)]:0;++h;var o=h<e.length?r[e.charAt(h)]:64;++h;var a=h<e.length?r[e.charAt(h)]:64;if(++h,null==n||null==i||null==o||null==a)throw Error();s.push(n<<2|i>>4),64!==o&&(s.push(i<<4&240|o>>2),64!==a&&s.push(o<<6&192|a))}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},l=function(e){var t=i(e);return h.encodeByteArray(t,!0)};class c extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,c.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,u.prototype.create)}}class u{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){var s,r=t[0]||{},n=`${this.service}/${e}`,i=this.errors[e],i=i?(s=r,i.replace(d,(e,t)=>{var r=s[t];return null!=r?String(r):`<${t}?>`})):"Error",i=`${this.serviceName}: ${i} (${n}).`;return new c(n,i,r)}}const d=/\{\$([^}]+)}/g;function _(e){return e&&e._delegate?e._delegate:e}class p{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const f="firebasestorage.googleapis.com",g="storageBucket";class m extends c{constructor(e,t){super(b(e),`Firebase Storage: ${t} (${b(e)})`),this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,m.prototype)}_codeEquals(e){return b(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}function b(e){return"storage/"+e}function v(){return new m("unknown","An unknown error occurred, please check the error payload for server response.")}function y(){return new m("canceled","User canceled the upload/download.")}function w(){return new m("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")}function T(e){return new m("invalid-argument",e)}function R(){return new m("app-deleted","The Firebase app was deleted.")}function k(e){return new m("invalid-root-operation","The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function S(e,t){return new m("invalid-format","String does not match format '"+e+"': "+t)}function C(e){throw new m("internal-error","Internal error: "+e)}class E{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o"}static makeFromBucketSpec(t,e){let r;try{r=E.makeFromUrl(t,e)}catch(e){return new E(t,"")}if(""===r.path)return r;throw t=t,new m("invalid-default-bucket","Invalid default bucket '"+t+"'.")}static makeFromUrl(e,t){let r=null;var s="([A-Za-z0-9.\\-_]+)";var n=new RegExp("^gs://"+s+"(/(.*))?$","i");function i(e){e.path_=decodeURIComponent(e.path)}var o=t.replace(/[.]/g,"\\."),a=new RegExp(`^https?://${o}/v[A-Za-z0-9_]+/b/${s}/o(/([^?#]*).*)?$`,"i"),o=t===f?"(?:storage.googleapis.com|storage.cloud.google.com)":t,h=[{regex:n,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:a,indices:{bucket:1,path:3},postModify:i},{regex:new RegExp(`^https?://${o}/${s}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:i}];for(let u=0;u<h.length;u++){const d=h[u];var l=d.regex.exec(e);if(l){var c=l[d.indices.bucket];let e=l[d.indices.path];e=e||"",r=new E(c,e),d.postModify(r);break}}if(null==r)throw t=e,new m("invalid-url","Invalid URL '"+t+"'.");return r}}class x{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=0){}}function A(e){return"string"==typeof e||e instanceof String}function U(e){return O()&&e instanceof Blob}function O(){return"undefined"!=typeof Blob}function P(e,t,r,s){if(s<t)throw T(`Invalid value for '${e}'. Expected ${t} or greater.`);if(r<s)throw T(`Invalid value for '${e}'. Expected ${r} or less.`)}function I(e,t,r){let s=null==r?`https://${t}`:t;return`${r}://${s}/v0${e}`}function M(e){const t=encodeURIComponent;let r="?";for(const n in e){var s;e.hasOwnProperty(n)&&(s=t(n)+"="+t(e[n]),r=r+s+"&")}return r=r.slice(0,-1),r}(t=o=o||{})[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT";class B{constructor(e,t,r,s,n,i,o,a,h,l,c){this.url_=e,this.method_=t,this.headers_=r,this.body_=s,this.successCodes_=n,this.additionalRetryCodes_=i,this.callback_=o,this.errorCallback_=a,this.timeout_=h,this.progressCallback_=l,this.connectionFactory_=c,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){var e=(s,e)=>{if(e)s(!1,new N(!1,null,!0));else{const n=this.connectionFactory_();this.pendingConnection_=n;const i=e=>{var t=e.loaded,r=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,r)};null!==this.progressCallback_&&n.addUploadProgressListener(i),n.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(i),this.pendingConnection_=null;var e,t=n.getErrorCode()===o.NO_ERROR,r=n.getStatus();t&&!this.isRetryStatusCode_(r)?(e=-1!==this.successCodes_.indexOf(r),s(!0,new N(e,n))):(e=n.getErrorCode()===o.ABORT,s(!1,new N(!1,null,e)))})}},t=(e,t)=>{const r=this.resolve_,s=this.reject_,n=t.connection;if(t.wasSuccessCode)try{var i=this.callback_(n,n.getResponse());void 0!==i?r(i):r()}catch(e){s(e)}else if(null!==n){const a=v();a.serverResponse=n.getErrorText(),this.errorCallback_?s(this.errorCallback_(n,a)):s(a)}else{var o;t.canceled?(o=(this.appDelete_?R:y)(),s(o)):(o=new m("retry-limit-exceeded","Max retry time for operation exceeded, please try again."),s(o))}};this.canceled_?t(0,new N(!1,null,!0)):this.backoffId_=function(t,r,e){let s=1,n=null,i=null,o=!1,a=0;function h(){return 2===a}let l=!1;function c(...e){l||(l=!0,r.apply(null,e))}function u(e){n=setTimeout(()=>{n=null,t(_,h())},e)}function d(){i&&clearTimeout(i)}function _(t,...r){if(l)d();else{if(t)return d(),void c.call(null,t,...r);if(h()||o)return d(),void c.call(null,t,...r);s<64&&(s*=2);let e;e=1===a?(a=2,0):1e3*(s+Math.random()),u(e)}}let p=!1;function f(e){p||(p=!0,d(),l||(null!==n?(e||(a=2),clearTimeout(n),u(0)):e||(a=1)))}return u(0),i=setTimeout(()=>{f(o=!0)},e),f}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}isRetryStatusCode_(e){var t=500<=e&&e<600,r=-1!==[408,429].indexOf(e),s=-1!==this.additionalRetryCodes_.indexOf(e);return t||r||s}}class N{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}function D(...t){const r="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0;if(void 0!==r){const s=new r;for(let e=0;e<t.length;e++)s.append(t[e]);return s.getBlob()}if(O())return new Blob(t);throw new m("unsupported-environment","This browser doesn't seem to support creating Blobs")}const L={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class q{constructor(e,t){this.data=e,this.contentType=t||null}}function F(e,t){switch(e){case L.RAW:return new q(j(t));case L.BASE64:case L.BASE64URL:return new q(z(e,t));case L.DATA_URL:return new q((r=t,(s=new H(r)).base64?z(L.BASE64,s.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(e){throw S(L.DATA_URL,"Malformed data URL.")}return j(t)}(s.rest)),(r=t,new H(r).contentType))}var r,s;throw v()}function j(t){const r=[];for(let i=0;i<t.length;i++){let e=t.charCodeAt(i);var s,n;e<=127?r.push(e):e<=2047?r.push(192|e>>6,128|63&e):55296==(64512&e)?i<t.length-1&&56320==(64512&t.charCodeAt(i+1))?(s=e,n=t.charCodeAt(++i),e=65536|(1023&s)<<10|1023&n,r.push(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e)):r.push(239,191,189):56320==(64512&e)?r.push(239,191,189):r.push(224|e>>12,128|e>>6&63,128|63&e)}return new Uint8Array(r)}function z(t,e){switch(t){case L.BASE64:var r=-1!==e.indexOf("-"),s=-1!==e.indexOf("_");if(r||s)throw S(t,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break;case L.BASE64URL:s=-1!==e.indexOf("+"),r=-1!==e.indexOf("/");if(s||r)throw S(t,"Invalid character '"+(s?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/")}let n;try{n=atob(e)}catch(e){throw S(t,"Invalid character found")}const i=new Uint8Array(n.length);for(let o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return i}class H{constructor(e){this.base64=!1,this.contentType=null;var t,r,s=e.match(/^data:([^,]+)?,/);if(null===s)throw S(L.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=s[1]||null;null!=n&&(this.base64=(t=n,r=";base64",t.length>=r.length&&t.substring(t.length-r.length)===r),this.contentType=this.base64?n.substring(0,n.length-";base64".length):n),this.rest=e.substring(e.indexOf(",")+1)}}class ${constructor(e,t){let r=0,s="";U(e)?(this.data_=e,r=e.size,s=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),r=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),r=e.length),this.size_=r,this.type_=s}size(){return this.size_}type(){return this.type_}slice(e,t){if(U(this.data_)){var r=this.data_,r=(n=e,i=t,(s=r).webkitSlice?s.webkitSlice(n,i):s.mozSlice?s.mozSlice(n,i):s.slice?s.slice(n,i):null);return null===r?null:new $(r)}var s,n,i,r=new Uint8Array(this.data_.buffer,e,t-e);return new $(r,!0)}static getBlob(...e){if(O()){var t=e.map(e=>e instanceof $?e.data_:e);return new $(D.apply(null,t))}{const s=e.map(e=>A(e)?F(L.RAW,e).data:e.data_);let t=0;s.forEach(e=>{t+=e.byteLength});const n=new Uint8Array(t);let r=0;return s.forEach(e=>{for(let t=0;t<e.length;t++)n[r++]=e[t]}),new $(n,!0)}}uploadData(){return this.data_}}function W(e){let t;try{t=JSON.parse(e)}catch(e){return null}return"object"!=typeof(e=t)||Array.isArray(e)?null:t}function V(e){var t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}function G(e,t){return t}class X{constructor(e,t,r,s){this.server=e,this.local=t||e,this.writable=!!r,this.xform=s||G}}let K=null;function J(){if(K)return K;const e=[];e.push(new X("bucket")),e.push(new X("generation")),e.push(new X("metageneration")),e.push(new X("name","fullPath",!0));const t=new X("name");t.xform=function(e,t){return!A(t=t)||t.length<2?t:V(t)},e.push(t);const r=new X("size");return r.xform=function(e,t){return void 0!==t?Number(t):t},e.push(r),e.push(new X("timeCreated")),e.push(new X("updated")),e.push(new X("md5Hash",null,!0)),e.push(new X("cacheControl",null,!0)),e.push(new X("contentDisposition",null,!0)),e.push(new X("contentEncoding",null,!0)),e.push(new X("contentLanguage",null,!0)),e.push(new X("contentType",null,!0)),e.push(new X("metadata","customMetadata",!0)),K=e,K}function Z(r,s){Object.defineProperty(r,"ref",{get:function(){var e=r.bucket,t=r.fullPath,t=new E(e,t);return s._makeStorageReference(t)}})}function Y(e,t,r){var s=W(t);return null===s?null:function(e,t,r){const s={type:"file"};var n=r.length;for(let i=0;i<n;i++){const o=r[i];s[o.local]=o.xform(s,t[o.server])}return Z(s,e),s}(e,s,r)}function Q(e,t){const r={};var s=t.length;for(let i=0;i<s;i++){var n=t[i];n.writable&&(r[n.server]=e[n.local])}return JSON.stringify(r)}const ee="prefixes";function te(e,t,r){var s=W(r);return null===s?null:function(e,t,r){const s={prefixes:[],items:[],nextPageToken:r.nextPageToken};if(r[ee])for(const o of r[ee]){var n=o.replace(/\/$/,""),n=e._makeStorageReference(new E(t,n));s.prefixes.push(n)}if(r.items)for(const a of r.items){var i=e._makeStorageReference(new E(t,a.name));s.items.push(i)}return s}(e,t,s)}class re{constructor(e,t,r,s){this.url=e,this.method=t,this.handler=r,this.timeout=s,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function se(e){if(!e)throw v()}function ne(s,n){return function(e,t){var r=Y(s,t,n);return se(null!==r),r}}function ie(s,n){return function(e,t){var r=te(s,n,t);return se(null!==r),r}}function oe(s,n){return function(e,t){var r=Y(s,t,n);return se(null!==r),function(s,e,n,i){var t=W(e);if(null===t)return null;if(!A(t.downloadTokens))return null;const r=t.downloadTokens;if(0===r.length)return null;const o=encodeURIComponent,a=r.split(",");return a.map(e=>{var t=s.bucket,r=s.fullPath;return I("/b/"+o(t)+"/o/"+o(r),n,i)+M({alt:"media",token:e})})[0]}(r,t,s.host,s._protocol)}}function ae(n){return function(e,t){let r;var s;return r=401===e.getStatus()?e.getErrorText().includes("Firebase App Check token is invalid")?new m("unauthorized-app","This app does not have permission to access Firebase Storage on this project."):new m("unauthenticated","User is not authenticated, please authenticate using Firebase Authentication and try again."):402===e.getStatus()?(s=n.bucket,new m("quota-exceeded","Quota for bucket '"+s+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===e.getStatus()?(e=n.path,new m("unauthorized","User does not have permission to access '"+e+"'.")):t,r.serverResponse=t.serverResponse,r}}function he(s){const n=ae(s);return function(e,t){let r=n(e,t);return 404===e.getStatus()&&(r=(e=s.path,new m("object-not-found","Object '"+e+"' does not exist."))),r.serverResponse=t.serverResponse,r}}function le(e,t,r){var s=I(t.fullServerUrl(),e.host,e._protocol),n=e.maxOperationRetryTime;const i=new re(s,"GET",ne(e,r),n);return i.errorHandler=he(t),i}function ce(e,t,r){const s=Object.assign({},r);return s.fullPath=e.path,s.size=t.size(),s.contentType||(s.contentType=(e=t,(t=null)&&t.contentType||e&&e.type()||"application/octet-stream")),s}function ue(e,t,r,s,n){var i=t.bucketOnlyServerUrl();const o={"X-Goog-Upload-Protocol":"multipart"};var a=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();o["Content-Type"]="multipart/related; boundary="+a;var h=ce(t,s,n),l="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+Q(h,r)+"\r\n--"+a+"\r\nContent-Type: "+h.contentType+"\r\n\r\n",a="\r\n--"+a+"--";const c=$.getBlob(l,s,a);if(null===c)throw w();a={name:h.fullPath},h=I(i,e.host,e._protocol),i=e.maxUploadRetryTime;const u=new re(h,"POST",ne(e,r),i);return u.urlParams=a,u.headers=o,u.body=c.uploadData(),u.errorHandler=ae(t),u}class de{constructor(e,t,r,s){this.current=e,this.total=t,this.finalized=!!r,this.metadata=s||null}}function _e(e,t){let r=null;try{r=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){se(!1)}const s=t||["active"];return se(!!r&&-1!==s.indexOf(r)),r}function pe(e,t,r,s,n){var i=t.bucketOnlyServerUrl(),o=ce(t,s,n),a={name:o.fullPath},h=I(i,e.host,e._protocol),l={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":o.contentType,"Content-Type":"application/json; charset=utf-8"},i=Q(o,r),o=e.maxUploadRetryTime;const c=new re(h,"POST",function(e){_e(e);let t;try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){se(!1)}return se(A(t)),t},o);return c.urlParams=a,c.headers=l,c.body=i,c.errorHandler=ae(t),c}function fe(e,t,r,n){var s=e.maxUploadRetryTime;const i=new re(r,"POST",function(e){var t=_e(e,["active","final"]);let r=null;try{r=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){se(!1)}r||se(!1);var s=Number(r);return se(!isNaN(s)),new de(s,n.size(),"final"===t)},s);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=ae(t),i}function ge(e,o,t,a,r,h,s,n){const l=new de(0,0);if(s?(l.current=s.current,l.total=s.total):(l.current=0,l.total=a.size()),a.size()!==l.total)throw new m("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.");var i=l.total-l.current;let c=i;0<r&&(c=Math.min(c,r));var u=l.current,d=u+c,i={"X-Goog-Upload-Command":c===i?"upload, finalize":"upload","X-Goog-Upload-Offset":`${l.current}`};const _=a.slice(u,d);if(null===_)throw w();d=o.maxUploadRetryTime;const p=new re(t,"POST",function(e,t){var r=_e(e,["active","final"]),s=l.current+c,n=a.size();let i;return i="final"===r?ne(o,h)(e,t):null,new de(s,n,"final"===r,i)},d);return p.headers=i,p.body=_.uploadData(),p.progressCallback=n||null,p.errorHandler=ae(e),p}const me={STATE_CHANGED:"state_changed"},be={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function ve(e){switch(e){case"running":case"pausing":case"canceling":return be.RUNNING;case"paused":return be.PAUSED;case"success":return be.SUCCESS;case"canceled":return be.CANCELED;default:return be.ERROR}}class ye{constructor(e,t,r){var s;"function"==typeof e||null!=t||null!=r?(this.next=e,this.error=null!=t?t:void 0,this.complete=null!=r?r:void 0):(this.next=(s=e).next,this.error=s.error,this.complete=s.complete)}}function we(t){return(...e)=>{Promise.resolve().then(()=>t(...e))}}class Te extends class{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=o.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=o.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=o.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,r,s){if(this.sent_)throw C("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==s)for(const n in s)s.hasOwnProperty(n)&&this.xhr_.setRequestHeader(n,s[n].toString());return void 0!==r?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw C("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw C("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}}getResponse(){if(!this.sent_)throw C("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw C("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}{initXhr(){this.xhr_.responseType="text"}}function Re(){return new Te}class ke{constructor(e,t,r=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=r,this._mappings=J(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=e=>{this._request=void 0,this._chunkMultiplier=1,e._codeEquals("canceled")?(this._needToFetchStatus=!0,this.completeTransitions_()):(this._error=e,this._transition("error"))},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals("canceled")?this.completeTransitions_():(this._error=e,this._transition("error"))},this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const t=this._transferred;return e=>this._updateProgress(t+e)}_shouldDoResumable(e){return 262144<e.size()}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())}_resolveToken(r){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([e,t])=>{switch(this._state){case"running":r(e,t);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((e,t)=>{var r=pe(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata);const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const n=this._uploadUrl;this._resolveToken((e,t)=>{var r=fe(this._ref.storage,this._ref._location,n,this._blob);const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const n=262144*this._chunkMultiplier,i=new de(this._transferred,this._blob.size()),o=this._uploadUrl;this._resolveToken((e,t)=>{let r;try{r=ge(this._ref._location,this._ref.storage,o,this._blob,n,this._mappings,i,this._makeProgressCallback())}catch(e){return this._error=e,void this._transition("error")}const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(e.current),e.finalized?(this._metadata=e.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){262144*this._chunkMultiplier<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{var r=le(this._ref.storage,this._ref._location,this._mappings);const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{var r=ue(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata);const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){var t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,void 0!==this._request&&this._request.cancel();break;case"running":var t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=y(),this._state=e,this._notifyObservers();break;case"error":case"success":this._state=e,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){var e=ve(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,r,s){const n=new ye(t||void 0,r||void 0,s||void 0);return this._addObserver(n),()=>{this._removeObserver(n)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){var t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise();const e=this._observers.slice();e.forEach(e=>{this._notifyObserver(e)})}_finishPromise(){if(void 0!==this._resolve){let e=!0;switch(ve(this._state)){case be.SUCCESS:we(this._resolve.bind(null,this.snapshot))();break;case be.CANCELED:case be.ERROR:const t=this._reject;we(t.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(ve(this._state)){case be.RUNNING:case be.PAUSED:e.next&&we(e.next.bind(e,this.snapshot))();break;case be.SUCCESS:e.complete&&we(e.complete.bind(e))();break;case be.CANCELED:case be.ERROR:default:e.error&&we(e.error.bind(e,this._error))()}}resume(){var e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e}pause(){var e="running"===this._state;return e&&this._transition("pausing"),e}cancel(){var e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e}}class Se{constructor(e,t){this._service=e,t instanceof E?this._location=t:this._location=E.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new Se(e,t)}get root(){var e=new E(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return V(this._location.path)}get storage(){return this._service}get parent(){var e=function(e){if(0===e.length)return null;var t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;e=new E(this._location.bucket,e);return new Se(this._service,e)}_throwIfRoot(e){if(""===this._location.path)throw k(e)}}function Ce(e){const t={prefixes:[],items:[]};return async function e(t,r,s){const n={pageToken:s};const i=await Ee(t,n);r.prefixes.push(...i.prefixes);r.items.push(...i.items);null!=i.nextPageToken&&await e(t,r,i.nextPageToken)}(e,t).then(()=>t)}function Ee(e,t){null!=t&&"number"==typeof t.maxResults&&P("options.maxResults",1,1e3,t.maxResults);var r=t||{},r=function(e,t,r,s,n){const i={};t.isRoot?i.prefix="":i.prefix=t.path+"/",r&&0<r.length&&(i.delimiter=r),s&&(i.pageToken=s),n&&(i.maxResults=n);var o=I(t.bucketOnlyServerUrl(),e.host,e._protocol),a=e.maxOperationRetryTime;const h=new re(o,"GET",ie(e,t.bucket),a);return h.urlParams=i,h.errorHandler=ae(t),h}(e.storage,e._location,"/",r.pageToken,r.maxResults);return e.storage.makeRequestWithTokens(r,Re)}function xe(e,t){e._throwIfRoot("updateMetadata");var r=function(e,t,r,s){var n=I(t.fullServerUrl(),e.host,e._protocol),i=Q(r,s),o=e.maxOperationRetryTime;const a=new re(n,"PATCH",ne(e,s),o);return a.headers={"Content-Type":"application/json; charset=utf-8"},a.body=i,a.errorHandler=he(t),a}(e.storage,e._location,t,J());return e.storage.makeRequestWithTokens(r,Re)}function Ae(e){e._throwIfRoot("getDownloadURL");var t=function(e,t,r){var s=I(t.fullServerUrl(),e.host,e._protocol),n=e.maxOperationRetryTime;const i=new re(s,"GET",oe(e,r),n);return i.errorHandler=he(t),i}(e.storage,e._location,J());return e.storage.makeRequestWithTokens(t,Re).then(e=>{if(null===e)throw new m("no-download-url","The given file does not have any download URLs.");return e})}function Ue(e){e._throwIfRoot("deleteObject");var t=function(e,t){var r=I(t.fullServerUrl(),e.host,e._protocol),s=e.maxOperationRetryTime;const n=new re(r,"DELETE",function(e,t){},s);return n.successCodes=[200,204],n.errorHandler=he(t),n}(e.storage,e._location);return e.storage.makeRequestWithTokens(t,Re)}function Oe(e,t){var r,s=(r=e._location.path,s=t.split("/").filter(e=>0<e.length).join("/"),0===r.length?s:r+"/"+s),s=new E(e._location.bucket,s);return new Se(e.storage,s)}function Pe(e,t){if(e instanceof Ne){var r=e;if(null==r._bucket)throw new m("no-default-bucket","No default bucket found. Did you set the '"+g+"' property when initializing the app?");r=new Se(r,r._bucket);return null!=t?Pe(r,t):r}return void 0!==t?Oe(e,t):e}function Ie(e,t){if(t&&/^[A-Za-z]+:\/\//.test(t)){if(e instanceof Ne)return r=e,s=t,new Se(r,s);throw T("To use ref(service, url), the first argument must be a Storage instance.")}return Pe(e,t);var r,s}function Me(e,t){var r=null==t?void 0:t[g];return null==r?null:E.makeFromBucketSpec(r,e)}function Be(e,t,r,s={}){e.host=`${t}:${r}`,e._protocol="http";var n=s["mockUserToken"];n&&(e._overrideAuthToken="string"==typeof n?n:function(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var r=t||"demo-project",s=e.iat||0,n=e.sub||e.user_id;if(!n)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");return n=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:n,user_id:n,firebase:{sign_in_provider:"custom",identities:{}}},e),[a(JSON.stringify({alg:"none",type:"JWT"})),a(JSON.stringify(n)),""].join(".")}(n,e.app.options.projectId))}class Ne{constructor(e,t,r,s,n){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=s,this._firebaseVersion=n,this._bucket=null,this._host=f,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=s?E.makeFromBucketSpec(s,this._host):Me(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=E.makeFromBucketSpec(this._url,e):this._bucket=Me(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){P("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){P("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){var t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Se(this,e)}_makeRequest(e,t,r,s){if(this._deleted)return new x(R());{const l=(n=e,i=this._appId,o=r,e=s,r=t,s=this._firebaseVersion,a=M(n.urlParams),h=n.url+a,a=Object.assign({},n.headers),t=a,(i=i)&&(t["X-Firebase-GMPID"]=i),i=a,null!==(o=o)&&0<o.length&&(i.Authorization="Firebase "+o),s=s,a["X-Firebase-Storage-Version"]="webjs/"+(null!=s?s:"AppManager"),s=a,null!==(e=e)&&(s["X-Firebase-AppCheck"]=e),new B(h,n.method,a,n.body,n.successCodes,n.additionalRetryCodes,n.handler,n.errorHandler,n.timeout,n.progressCallback,r));return this._requests.add(l),l.getPromise().then(()=>this._requests.delete(l),()=>this._requests.delete(l)),l}var n,i,o,a,h}async makeRequestWithTokens(e,t){var[r,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,r,s).getPromise()}}const De="@firebase/storage",Le="0.9.1-canary.044a8d7f9";function qe(e,t,r){return e=_(e),t=t,r=r,(e=e)._throwIfRoot("uploadBytesResumable"),new ke(e,new $(t),r)}function Fe(e){return function(e){e._throwIfRoot("getMetadata");var t=le(e.storage,e._location,J());return e.storage.makeRequestWithTokens(t,Re)}(e=_(e))}function je(e,t){return Ie(e=_(e),t)}function ze(e,{instanceIdentifier:t}){var r=e.getProvider("app").getImmediate(),s=e.getProvider("auth-internal"),n=e.getProvider("app-check-internal");return new Ne(r,s,n,t,Ze.SDK_VERSION)}Ze._registerComponent(new p("storage",ze,"PUBLIC").setMultipleInstances(!0)),Ze.registerVersion(De,Le,""),Ze.registerVersion(De,Le,"esm2017");class He{constructor(e,t,r){this._delegate=e,this.task=t,this.ref=r}get bytesTransferred(){return this._delegate.bytesTransferred}get metadata(){return this._delegate.metadata}get state(){return this._delegate.state}get totalBytes(){return this._delegate.totalBytes}}class $e{constructor(e,t){this._delegate=e,this._ref=t,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}get snapshot(){return new He(this._delegate.snapshot,this,this._ref)}then(t,e){return this._delegate.then(e=>{if(t)return t(new He(e,this,this._ref))},e)}on(e,t,r,s){let n=void 0;return t&&(n="function"==typeof t?e=>t(new He(e,this,this._ref)):{next:t.next?e=>t.next(new He(e,this,this._ref)):void 0,complete:t.complete||void 0,error:t.error||void 0}),this._delegate.on(e,n,r||void 0,s||void 0)}}class We{constructor(e,t){this._delegate=e,this._service=t}get prefixes(){return this._delegate.prefixes.map(e=>new Ve(e,this._service))}get items(){return this._delegate.items.map(e=>new Ve(e,this._service))}get nextPageToken(){return this._delegate.nextPageToken||null}}class Ve{constructor(e,t){this._delegate=e,this.storage=t}get name(){return this._delegate.name}get bucket(){return this._delegate.bucket}get fullPath(){return this._delegate.fullPath}toString(){return this._delegate.toString()}child(e){var t=Oe(this._delegate,e);return new Ve(t,this.storage)}get root(){return new Ve(this._delegate.root,this.storage)}get parent(){var e=this._delegate.parent;return null==e?null:new Ve(e,this.storage)}put(e,t){return this._throwIfRoot("put"),new $e(qe(this._delegate,e,t),this)}putString(e,t=L.RAW,r){this._throwIfRoot("putString");var s=F(t,e);const n=Object.assign({},r);return null==n.contentType&&null!=s.contentType&&(n.contentType=s.contentType),new $e(new ke(this._delegate,new $(s.data,!0),n),this)}listAll(){return Ce(_(this._delegate)).then(e=>new We(e,this.storage))}list(e){return t=this._delegate,e=e||void 0,Ee(t=_(t),e).then(e=>new We(e,this.storage));var t}getMetadata(){return Fe(this._delegate)}updateMetadata(e){return xe(_(this._delegate),e)}getDownloadURL(){return Ae(_(this._delegate))}delete(){return this._throwIfRoot("delete"),Ue(_(this._delegate))}_throwIfRoot(e){if(""===this._delegate._location.path)throw k(e)}}class Ge{constructor(e,t){this.app=e,this._delegate=t}get maxOperationRetryTime(){return this._delegate.maxOperationRetryTime}get maxUploadRetryTime(){return this._delegate.maxUploadRetryTime}ref(e){if(Xe(e))throw T("ref() expected a child path but got a URL, use refFromURL instead.");return new Ve(je(this._delegate,e),this)}refFromURL(e){if(!Xe(e))throw T("refFromURL() expected a full URL but got a child path, use ref() instead.");try{E.makeFromUrl(e,this._delegate.host)}catch(e){throw T("refFromUrl() expected a valid full URL but got an invalid one.")}return new Ve(je(this._delegate,e),this)}setMaxUploadRetryTime(e){this._delegate.maxUploadRetryTime=e}setMaxOperationRetryTime(e){this._delegate.maxOperationRetryTime=e}useEmulator(e,t,r={}){var s;[s,e,t,r={}]=[this._delegate,e,t,r],Be(s,e,t,r)}}function Xe(e){return/^[A-Za-z]+:\/\//.test(e)}function Ke(e,{instanceIdentifier:t}){var r=e.getProvider("app-compat").getImmediate(),s=e.getProvider("storage").getImmediate({identifier:t});return new Ge(r,s)}r=n.default,s={TaskState:be,TaskEvent:me,StringFormat:L,Storage:Ge,Reference:Ve},r.INTERNAL.registerComponent(new p("storage-compat",Ke,"PUBLIC").setServiceProps(s).setMultipleInstances(!0)),r.registerVersion("@firebase/storage-compat","0.1.9-canary.044a8d7f9")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-storage-compat.js - be sure to load firebase-app.js first.")}});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,function(Je,Ze){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o,t,r,s,n=e(Je);function i(t){const r=[];let s=0;for(let n=0;n<t.length;n++){let e=t.charCodeAt(n);e<128?r[s++]=e:(e<2048?r[s++]=e>>6|192:(55296==(64512&e)&&n+1<t.length&&56320==(64512&t.charCodeAt(n+1))?(e=65536+((1023&e)<<10)+(1023&t.charCodeAt(++n)),r[s++]=e>>18|240,r[s++]=e>>12&63|128):r[s++]=e>>12|224,r[s++]=e>>6&63|128),r[s++]=63&e|128)}return r}function a(e){return l(e).replace(/\./g,"")}const h={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(r,e){if(!Array.isArray(r))throw Error("encodeByteArray takes an array as a parameter");this.init_();var s=e?this.byteToCharMapWebSafe_:this.byteToCharMap_;const n=[];for(let c=0;c<r.length;c+=3){var i=r[c],o=c+1<r.length,a=o?r[c+1]:0,h=c+2<r.length,l=h?r[c+2]:0;let e=(15&a)<<2|l>>6,t=63&l;h||(t=64,o||(e=64)),n.push(s[i>>2],s[(3&i)<<4|a>>4],s[e],s[t])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(i(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let r=0,s=0;for(;r<e.length;){var n,i,o=e[r++];o<128?t[s++]=String.fromCharCode(o):191<o&&o<224?(n=e[r++],t[s++]=String.fromCharCode((31&o)<<6|63&n)):239<o&&o<365?(i=((7&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t[s++]=String.fromCharCode(55296+(i>>10)),t[s++]=String.fromCharCode(56320+(1023&i))):(n=e[r++],i=e[r++],t[s++]=String.fromCharCode((15&o)<<12|(63&n)<<6|63&i))}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();var r=t?this.charToByteMapWebSafe_:this.charToByteMap_;const s=[];for(let h=0;h<e.length;){var n=r[e.charAt(h++)],i=h<e.length?r[e.charAt(h)]:0;++h;var o=h<e.length?r[e.charAt(h)]:64;++h;var a=h<e.length?r[e.charAt(h)]:64;if(++h,null==n||null==i||null==o||null==a)throw Error();s.push(n<<2|i>>4),64!==o&&(s.push(i<<4&240|o>>2),64!==a&&s.push(o<<6&192|a))}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},l=function(e){var t=i(e);return h.encodeByteArray(t,!0)};class c extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,c.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,u.prototype.create)}}class u{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){var s,r=t[0]||{},n=`${this.service}/${e}`,i=this.errors[e],i=i?(s=r,i.replace(d,(e,t)=>{var r=s[t];return null!=r?String(r):`<${t}?>`})):"Error",i=`${this.serviceName}: ${i} (${n}).`;return new c(n,i,r)}}const d=/\{\$([^}]+)}/g;function _(e){return e&&e._delegate?e._delegate:e}class p{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const f="firebasestorage.googleapis.com",g="storageBucket";class m extends c{constructor(e,t){super(b(e),`Firebase Storage: ${t} (${b(e)})`),this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,m.prototype)}_codeEquals(e){return b(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}function b(e){return"storage/"+e}function v(){return new m("unknown","An unknown error occurred, please check the error payload for server response.")}function y(){return new m("canceled","User canceled the upload/download.")}function w(){return new m("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")}function T(e){return new m("invalid-argument",e)}function R(){return new m("app-deleted","The Firebase app was deleted.")}function k(e){return new m("invalid-root-operation","The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function S(e,t){return new m("invalid-format","String does not match format '"+e+"': "+t)}function C(e){throw new m("internal-error","Internal error: "+e)}class E{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o"}static makeFromBucketSpec(t,e){let r;try{r=E.makeFromUrl(t,e)}catch(e){return new E(t,"")}if(""===r.path)return r;throw t=t,new m("invalid-default-bucket","Invalid default bucket '"+t+"'.")}static makeFromUrl(e,t){let r=null;var s="([A-Za-z0-9.\\-_]+)";var n=new RegExp("^gs://"+s+"(/(.*))?$","i");function i(e){e.path_=decodeURIComponent(e.path)}var o=t.replace(/[.]/g,"\\."),a=new RegExp(`^https?://${o}/v[A-Za-z0-9_]+/b/${s}/o(/([^?#]*).*)?$`,"i"),o=t===f?"(?:storage.googleapis.com|storage.cloud.google.com)":t,h=[{regex:n,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:a,indices:{bucket:1,path:3},postModify:i},{regex:new RegExp(`^https?://${o}/${s}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:i}];for(let u=0;u<h.length;u++){const d=h[u];var l=d.regex.exec(e);if(l){var c=l[d.indices.bucket];let e=l[d.indices.path];e=e||"",r=new E(c,e),d.postModify(r);break}}if(null==r)throw t=e,new m("invalid-url","Invalid URL '"+t+"'.");return r}}class x{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=0){}}function A(e){return"string"==typeof e||e instanceof String}function U(e){return O()&&e instanceof Blob}function O(){return"undefined"!=typeof Blob}function P(e,t,r,s){if(s<t)throw T(`Invalid value for '${e}'. Expected ${t} or greater.`);if(r<s)throw T(`Invalid value for '${e}'. Expected ${r} or less.`)}function I(e,t,r){let s=null==r?`https://${t}`:t;return`${r}://${s}/v0${e}`}function M(e){const t=encodeURIComponent;let r="?";for(const n in e){var s;e.hasOwnProperty(n)&&(s=t(n)+"="+t(e[n]),r=r+s+"&")}return r=r.slice(0,-1),r}(t=o=o||{})[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT";class B{constructor(e,t,r,s,n,i,o,a,h,l,c){this.url_=e,this.method_=t,this.headers_=r,this.body_=s,this.successCodes_=n,this.additionalRetryCodes_=i,this.callback_=o,this.errorCallback_=a,this.timeout_=h,this.progressCallback_=l,this.connectionFactory_=c,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){var e=(s,e)=>{if(e)s(!1,new N(!1,null,!0));else{const n=this.connectionFactory_();this.pendingConnection_=n;const i=e=>{var t=e.loaded,r=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,r)};null!==this.progressCallback_&&n.addUploadProgressListener(i),n.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(i),this.pendingConnection_=null;var e,t=n.getErrorCode()===o.NO_ERROR,r=n.getStatus();t&&!this.isRetryStatusCode_(r)?(e=-1!==this.successCodes_.indexOf(r),s(!0,new N(e,n))):(e=n.getErrorCode()===o.ABORT,s(!1,new N(!1,null,e)))})}},t=(e,t)=>{const r=this.resolve_,s=this.reject_,n=t.connection;if(t.wasSuccessCode)try{var i=this.callback_(n,n.getResponse());void 0!==i?r(i):r()}catch(e){s(e)}else if(null!==n){const a=v();a.serverResponse=n.getErrorText(),this.errorCallback_?s(this.errorCallback_(n,a)):s(a)}else{var o;t.canceled?(o=(this.appDelete_?R:y)(),s(o)):(o=new m("retry-limit-exceeded","Max retry time for operation exceeded, please try again."),s(o))}};this.canceled_?t(0,new N(!1,null,!0)):this.backoffId_=function(t,r,e){let s=1,n=null,i=null,o=!1,a=0;function h(){return 2===a}let l=!1;function c(...e){l||(l=!0,r.apply(null,e))}function u(e){n=setTimeout(()=>{n=null,t(_,h())},e)}function d(){i&&clearTimeout(i)}function _(t,...r){if(l)d();else{if(t)return d(),void c.call(null,t,...r);if(h()||o)return d(),void c.call(null,t,...r);s<64&&(s*=2);let e;e=1===a?(a=2,0):1e3*(s+Math.random()),u(e)}}let p=!1;function f(e){p||(p=!0,d(),l||(null!==n?(e||(a=2),clearTimeout(n),u(0)):e||(a=1)))}return u(0),i=setTimeout(()=>{f(o=!0)},e),f}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}isRetryStatusCode_(e){var t=500<=e&&e<600,r=-1!==[408,429].indexOf(e),s=-1!==this.additionalRetryCodes_.indexOf(e);return t||r||s}}class N{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}function D(...t){const r="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0;if(void 0!==r){const s=new r;for(let e=0;e<t.length;e++)s.append(t[e]);return s.getBlob()}if(O())return new Blob(t);throw new m("unsupported-environment","This browser doesn't seem to support creating Blobs")}const L={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class q{constructor(e,t){this.data=e,this.contentType=t||null}}function F(e,t){switch(e){case L.RAW:return new q(j(t));case L.BASE64:case L.BASE64URL:return new q(z(e,t));case L.DATA_URL:return new q((r=t,(s=new H(r)).base64?z(L.BASE64,s.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(e){throw S(L.DATA_URL,"Malformed data URL.")}return j(t)}(s.rest)),(r=t,new H(r).contentType))}var r,s;throw v()}function j(t){const r=[];for(let i=0;i<t.length;i++){let e=t.charCodeAt(i);var s,n;e<=127?r.push(e):e<=2047?r.push(192|e>>6,128|63&e):55296==(64512&e)?i<t.length-1&&56320==(64512&t.charCodeAt(i+1))?(s=e,n=t.charCodeAt(++i),e=65536|(1023&s)<<10|1023&n,r.push(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e)):r.push(239,191,189):56320==(64512&e)?r.push(239,191,189):r.push(224|e>>12,128|e>>6&63,128|63&e)}return new Uint8Array(r)}function z(t,e){switch(t){case L.BASE64:var r=-1!==e.indexOf("-"),s=-1!==e.indexOf("_");if(r||s)throw S(t,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break;case L.BASE64URL:s=-1!==e.indexOf("+"),r=-1!==e.indexOf("/");if(s||r)throw S(t,"Invalid character '"+(s?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/")}let n;try{n=atob(e)}catch(e){throw S(t,"Invalid character found")}const i=new Uint8Array(n.length);for(let o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return i}class H{constructor(e){this.base64=!1,this.contentType=null;var t,r,s=e.match(/^data:([^,]+)?,/);if(null===s)throw S(L.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=s[1]||null;null!=n&&(this.base64=(t=n,r=";base64",t.length>=r.length&&t.substring(t.length-r.length)===r),this.contentType=this.base64?n.substring(0,n.length-";base64".length):n),this.rest=e.substring(e.indexOf(",")+1)}}class ${constructor(e,t){let r=0,s="";U(e)?(this.data_=e,r=e.size,s=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),r=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),r=e.length),this.size_=r,this.type_=s}size(){return this.size_}type(){return this.type_}slice(e,t){if(U(this.data_)){var r=this.data_,r=(n=e,i=t,(s=r).webkitSlice?s.webkitSlice(n,i):s.mozSlice?s.mozSlice(n,i):s.slice?s.slice(n,i):null);return null===r?null:new $(r)}var s,n,i,r=new Uint8Array(this.data_.buffer,e,t-e);return new $(r,!0)}static getBlob(...e){if(O()){var t=e.map(e=>e instanceof $?e.data_:e);return new $(D.apply(null,t))}{const s=e.map(e=>A(e)?F(L.RAW,e).data:e.data_);let t=0;s.forEach(e=>{t+=e.byteLength});const n=new Uint8Array(t);let r=0;return s.forEach(e=>{for(let t=0;t<e.length;t++)n[r++]=e[t]}),new $(n,!0)}}uploadData(){return this.data_}}function W(e){let t;try{t=JSON.parse(e)}catch(e){return null}return"object"!=typeof(e=t)||Array.isArray(e)?null:t}function V(e){var t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}function G(e,t){return t}class X{constructor(e,t,r,s){this.server=e,this.local=t||e,this.writable=!!r,this.xform=s||G}}let K=null;function J(){if(K)return K;const e=[];e.push(new X("bucket")),e.push(new X("generation")),e.push(new X("metageneration")),e.push(new X("name","fullPath",!0));const t=new X("name");t.xform=function(e,t){return!A(t=t)||t.length<2?t:V(t)},e.push(t);const r=new X("size");return r.xform=function(e,t){return void 0!==t?Number(t):t},e.push(r),e.push(new X("timeCreated")),e.push(new X("updated")),e.push(new X("md5Hash",null,!0)),e.push(new X("cacheControl",null,!0)),e.push(new X("contentDisposition",null,!0)),e.push(new X("contentEncoding",null,!0)),e.push(new X("contentLanguage",null,!0)),e.push(new X("contentType",null,!0)),e.push(new X("metadata","customMetadata",!0)),K=e,K}function Z(r,s){Object.defineProperty(r,"ref",{get:function(){var e=r.bucket,t=r.fullPath,t=new E(e,t);return s._makeStorageReference(t)}})}function Y(e,t,r){var s=W(t);return null===s?null:function(e,t,r){const s={type:"file"};var n=r.length;for(let i=0;i<n;i++){const o=r[i];s[o.local]=o.xform(s,t[o.server])}return Z(s,e),s}(e,s,r)}function Q(e,t){const r={};var s=t.length;for(let i=0;i<s;i++){var n=t[i];n.writable&&(r[n.server]=e[n.local])}return JSON.stringify(r)}const ee="prefixes";function te(e,t,r){var s=W(r);return null===s?null:function(e,t,r){const s={prefixes:[],items:[],nextPageToken:r.nextPageToken};if(r[ee])for(const o of r[ee]){var n=o.replace(/\/$/,""),n=e._makeStorageReference(new E(t,n));s.prefixes.push(n)}if(r.items)for(const a of r.items){var i=e._makeStorageReference(new E(t,a.name));s.items.push(i)}return s}(e,t,s)}class re{constructor(e,t,r,s){this.url=e,this.method=t,this.handler=r,this.timeout=s,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function se(e){if(!e)throw v()}function ne(s,n){return function(e,t){var r=Y(s,t,n);return se(null!==r),r}}function ie(s,n){return function(e,t){var r=te(s,n,t);return se(null!==r),r}}function oe(s,n){return function(e,t){var r=Y(s,t,n);return se(null!==r),function(s,e,n,i){var t=W(e);if(null===t)return null;if(!A(t.downloadTokens))return null;const r=t.downloadTokens;if(0===r.length)return null;const o=encodeURIComponent,a=r.split(",");return a.map(e=>{var t=s.bucket,r=s.fullPath;return I("/b/"+o(t)+"/o/"+o(r),n,i)+M({alt:"media",token:e})})[0]}(r,t,s.host,s._protocol)}}function ae(n){return function(e,t){let r;var s;return r=401===e.getStatus()?e.getErrorText().includes("Firebase App Check token is invalid")?new m("unauthorized-app","This app does not have permission to access Firebase Storage on this project."):new m("unauthenticated","User is not authenticated, please authenticate using Firebase Authentication and try again."):402===e.getStatus()?(s=n.bucket,new m("quota-exceeded","Quota for bucket '"+s+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===e.getStatus()?(e=n.path,new m("unauthorized","User does not have permission to access '"+e+"'.")):t,r.serverResponse=t.serverResponse,r}}function he(s){const n=ae(s);return function(e,t){let r=n(e,t);return 404===e.getStatus()&&(r=(e=s.path,new m("object-not-found","Object '"+e+"' does not exist."))),r.serverResponse=t.serverResponse,r}}function le(e,t,r){var s=I(t.fullServerUrl(),e.host,e._protocol),n=e.maxOperationRetryTime;const i=new re(s,"GET",ne(e,r),n);return i.errorHandler=he(t),i}function ce(e,t,r){const s=Object.assign({},r);return s.fullPath=e.path,s.size=t.size(),s.contentType||(s.contentType=(e=t,(t=null)&&t.contentType||e&&e.type()||"application/octet-stream")),s}function ue(e,t,r,s,n){var i=t.bucketOnlyServerUrl();const o={"X-Goog-Upload-Protocol":"multipart"};var a=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();o["Content-Type"]="multipart/related; boundary="+a;var h=ce(t,s,n),l="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+Q(h,r)+"\r\n--"+a+"\r\nContent-Type: "+h.contentType+"\r\n\r\n",a="\r\n--"+a+"--";const c=$.getBlob(l,s,a);if(null===c)throw w();a={name:h.fullPath},h=I(i,e.host,e._protocol),i=e.maxUploadRetryTime;const u=new re(h,"POST",ne(e,r),i);return u.urlParams=a,u.headers=o,u.body=c.uploadData(),u.errorHandler=ae(t),u}class de{constructor(e,t,r,s){this.current=e,this.total=t,this.finalized=!!r,this.metadata=s||null}}function _e(e,t){let r=null;try{r=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){se(!1)}const s=t||["active"];return se(!!r&&-1!==s.indexOf(r)),r}function pe(e,t,r,s,n){var i=t.bucketOnlyServerUrl(),o=ce(t,s,n),a={name:o.fullPath},h=I(i,e.host,e._protocol),l={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":o.contentType,"Content-Type":"application/json; charset=utf-8"},i=Q(o,r),o=e.maxUploadRetryTime;const c=new re(h,"POST",function(e){_e(e);let t;try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){se(!1)}return se(A(t)),t},o);return c.urlParams=a,c.headers=l,c.body=i,c.errorHandler=ae(t),c}function fe(e,t,r,n){var s=e.maxUploadRetryTime;const i=new re(r,"POST",function(e){var t=_e(e,["active","final"]);let r=null;try{r=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){se(!1)}r||se(!1);var s=Number(r);return se(!isNaN(s)),new de(s,n.size(),"final"===t)},s);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=ae(t),i}function ge(e,o,t,a,r,h,s,n){const l=new de(0,0);if(s?(l.current=s.current,l.total=s.total):(l.current=0,l.total=a.size()),a.size()!==l.total)throw new m("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.");var i=l.total-l.current;let c=i;0<r&&(c=Math.min(c,r));var u=l.current,d=u+c,i={"X-Goog-Upload-Command":c===i?"upload, finalize":"upload","X-Goog-Upload-Offset":`${l.current}`};const _=a.slice(u,d);if(null===_)throw w();d=o.maxUploadRetryTime;const p=new re(t,"POST",function(e,t){var r=_e(e,["active","final"]),s=l.current+c,n=a.size();let i;return i="final"===r?ne(o,h)(e,t):null,new de(s,n,"final"===r,i)},d);return p.headers=i,p.body=_.uploadData(),p.progressCallback=n||null,p.errorHandler=ae(e),p}const me={STATE_CHANGED:"state_changed"},be={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function ve(e){switch(e){case"running":case"pausing":case"canceling":return be.RUNNING;case"paused":return be.PAUSED;case"success":return be.SUCCESS;case"canceled":return be.CANCELED;default:return be.ERROR}}class ye{constructor(e,t,r){var s;"function"==typeof e||null!=t||null!=r?(this.next=e,this.error=null!=t?t:void 0,this.complete=null!=r?r:void 0):(this.next=(s=e).next,this.error=s.error,this.complete=s.complete)}}function we(t){return(...e)=>{Promise.resolve().then(()=>t(...e))}}class Te extends class{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=o.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=o.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=o.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,r,s){if(this.sent_)throw C("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==s)for(const n in s)s.hasOwnProperty(n)&&this.xhr_.setRequestHeader(n,s[n].toString());return void 0!==r?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw C("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw C("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}}getResponse(){if(!this.sent_)throw C("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw C("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}{initXhr(){this.xhr_.responseType="text"}}function Re(){return new Te}class ke{constructor(e,t,r=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=r,this._mappings=J(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=e=>{this._request=void 0,this._chunkMultiplier=1,e._codeEquals("canceled")?(this._needToFetchStatus=!0,this.completeTransitions_()):(this._error=e,this._transition("error"))},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals("canceled")?this.completeTransitions_():(this._error=e,this._transition("error"))},this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const t=this._transferred;return e=>this._updateProgress(t+e)}_shouldDoResumable(e){return 262144<e.size()}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())}_resolveToken(r){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([e,t])=>{switch(this._state){case"running":r(e,t);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((e,t)=>{var r=pe(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata);const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const n=this._uploadUrl;this._resolveToken((e,t)=>{var r=fe(this._ref.storage,this._ref._location,n,this._blob);const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const n=262144*this._chunkMultiplier,i=new de(this._transferred,this._blob.size()),o=this._uploadUrl;this._resolveToken((e,t)=>{let r;try{r=ge(this._ref._location,this._ref.storage,o,this._blob,n,this._mappings,i,this._makeProgressCallback())}catch(e){return this._error=e,void this._transition("error")}const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(e.current),e.finalized?(this._metadata=e.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){262144*this._chunkMultiplier<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{var r=le(this._ref.storage,this._ref._location,this._mappings);const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{var r=ue(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata);const s=this._ref.storage._makeRequest(r,Re,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){var t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,void 0!==this._request&&this._request.cancel();break;case"running":var t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=y(),this._state=e,this._notifyObservers();break;case"error":case"success":this._state=e,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){var e=ve(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,r,s){const n=new ye(t||void 0,r||void 0,s||void 0);return this._addObserver(n),()=>{this._removeObserver(n)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){var t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise();const e=this._observers.slice();e.forEach(e=>{this._notifyObserver(e)})}_finishPromise(){if(void 0!==this._resolve){let e=!0;switch(ve(this._state)){case be.SUCCESS:we(this._resolve.bind(null,this.snapshot))();break;case be.CANCELED:case be.ERROR:const t=this._reject;we(t.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(ve(this._state)){case be.RUNNING:case be.PAUSED:e.next&&we(e.next.bind(e,this.snapshot))();break;case be.SUCCESS:e.complete&&we(e.complete.bind(e))();break;case be.CANCELED:case be.ERROR:default:e.error&&we(e.error.bind(e,this._error))()}}resume(){var e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e}pause(){var e="running"===this._state;return e&&this._transition("pausing"),e}cancel(){var e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e}}class Se{constructor(e,t){this._service=e,t instanceof E?this._location=t:this._location=E.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new Se(e,t)}get root(){var e=new E(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return V(this._location.path)}get storage(){return this._service}get parent(){var e=function(e){if(0===e.length)return null;var t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;e=new E(this._location.bucket,e);return new Se(this._service,e)}_throwIfRoot(e){if(""===this._location.path)throw k(e)}}function Ce(e){const t={prefixes:[],items:[]};return async function e(t,r,s){const n={pageToken:s};const i=await Ee(t,n);r.prefixes.push(...i.prefixes);r.items.push(...i.items);null!=i.nextPageToken&&await e(t,r,i.nextPageToken)}(e,t).then(()=>t)}function Ee(e,t){null!=t&&"number"==typeof t.maxResults&&P("options.maxResults",1,1e3,t.maxResults);var r=t||{},r=function(e,t,r,s,n){const i={};t.isRoot?i.prefix="":i.prefix=t.path+"/",r&&0<r.length&&(i.delimiter=r),s&&(i.pageToken=s),n&&(i.maxResults=n);var o=I(t.bucketOnlyServerUrl(),e.host,e._protocol),a=e.maxOperationRetryTime;const h=new re(o,"GET",ie(e,t.bucket),a);return h.urlParams=i,h.errorHandler=ae(t),h}(e.storage,e._location,"/",r.pageToken,r.maxResults);return e.storage.makeRequestWithTokens(r,Re)}function xe(e,t){e._throwIfRoot("updateMetadata");var r=function(e,t,r,s){var n=I(t.fullServerUrl(),e.host,e._protocol),i=Q(r,s),o=e.maxOperationRetryTime;const a=new re(n,"PATCH",ne(e,s),o);return a.headers={"Content-Type":"application/json; charset=utf-8"},a.body=i,a.errorHandler=he(t),a}(e.storage,e._location,t,J());return e.storage.makeRequestWithTokens(r,Re)}function Ae(e){e._throwIfRoot("getDownloadURL");var t=function(e,t,r){var s=I(t.fullServerUrl(),e.host,e._protocol),n=e.maxOperationRetryTime;const i=new re(s,"GET",oe(e,r),n);return i.errorHandler=he(t),i}(e.storage,e._location,J());return e.storage.makeRequestWithTokens(t,Re).then(e=>{if(null===e)throw new m("no-download-url","The given file does not have any download URLs.");return e})}function Ue(e){e._throwIfRoot("deleteObject");var t=function(e,t){var r=I(t.fullServerUrl(),e.host,e._protocol),s=e.maxOperationRetryTime;const n=new re(r,"DELETE",function(e,t){},s);return n.successCodes=[200,204],n.errorHandler=he(t),n}(e.storage,e._location);return e.storage.makeRequestWithTokens(t,Re)}function Oe(e,t){var r,s=(r=e._location.path,s=t.split("/").filter(e=>0<e.length).join("/"),0===r.length?s:r+"/"+s),s=new E(e._location.bucket,s);return new Se(e.storage,s)}function Pe(e,t){if(e instanceof Ne){var r=e;if(null==r._bucket)throw new m("no-default-bucket","No default bucket found. Did you set the '"+g+"' property when initializing the app?");r=new Se(r,r._bucket);return null!=t?Pe(r,t):r}return void 0!==t?Oe(e,t):e}function Ie(e,t){if(t&&/^[A-Za-z]+:\/\//.test(t)){if(e instanceof Ne)return r=e,s=t,new Se(r,s);throw T("To use ref(service, url), the first argument must be a Storage instance.")}return Pe(e,t);var r,s}function Me(e,t){var r=null==t?void 0:t[g];return null==r?null:E.makeFromBucketSpec(r,e)}function Be(e,t,r,s={}){e.host=`${t}:${r}`,e._protocol="http";var n=s["mockUserToken"];n&&(e._overrideAuthToken="string"==typeof n?n:function(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var r=t||"demo-project",s=e.iat||0,n=e.sub||e.user_id;if(!n)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");return n=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:n,user_id:n,firebase:{sign_in_provider:"custom",identities:{}}},e),[a(JSON.stringify({alg:"none",type:"JWT"})),a(JSON.stringify(n)),""].join(".")}(n,e.app.options.projectId))}class Ne{constructor(e,t,r,s,n){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=s,this._firebaseVersion=n,this._bucket=null,this._host=f,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=s?E.makeFromBucketSpec(s,this._host):Me(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=E.makeFromBucketSpec(this._url,e):this._bucket=Me(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){P("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){P("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){var t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Se(this,e)}_makeRequest(e,t,r,s){if(this._deleted)return new x(R());{const l=(n=e,i=this._appId,o=r,e=s,r=t,s=this._firebaseVersion,a=M(n.urlParams),h=n.url+a,a=Object.assign({},n.headers),t=a,(i=i)&&(t["X-Firebase-GMPID"]=i),i=a,null!==(o=o)&&0<o.length&&(i.Authorization="Firebase "+o),s=s,a["X-Firebase-Storage-Version"]="webjs/"+(null!=s?s:"AppManager"),s=a,null!==(e=e)&&(s["X-Firebase-AppCheck"]=e),new B(h,n.method,a,n.body,n.successCodes,n.additionalRetryCodes,n.handler,n.errorHandler,n.timeout,n.progressCallback,r));return this._requests.add(l),l.getPromise().then(()=>this._requests.delete(l),()=>this._requests.delete(l)),l}var n,i,o,a,h}async makeRequestWithTokens(e,t){var[r,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,r,s).getPromise()}}const De="@firebase/storage",Le="0.9.1-canary.88d43ec00";function qe(e,t,r){return e=_(e),t=t,r=r,(e=e)._throwIfRoot("uploadBytesResumable"),new ke(e,new $(t),r)}function Fe(e){return function(e){e._throwIfRoot("getMetadata");var t=le(e.storage,e._location,J());return e.storage.makeRequestWithTokens(t,Re)}(e=_(e))}function je(e,t){return Ie(e=_(e),t)}function ze(e,{instanceIdentifier:t}){var r=e.getProvider("app").getImmediate(),s=e.getProvider("auth-internal"),n=e.getProvider("app-check-internal");return new Ne(r,s,n,t,Ze.SDK_VERSION)}Ze._registerComponent(new p("storage",ze,"PUBLIC").setMultipleInstances(!0)),Ze.registerVersion(De,Le,""),Ze.registerVersion(De,Le,"esm2017");class He{constructor(e,t,r){this._delegate=e,this.task=t,this.ref=r}get bytesTransferred(){return this._delegate.bytesTransferred}get metadata(){return this._delegate.metadata}get state(){return this._delegate.state}get totalBytes(){return this._delegate.totalBytes}}class $e{constructor(e,t){this._delegate=e,this._ref=t,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}get snapshot(){return new He(this._delegate.snapshot,this,this._ref)}then(t,e){return this._delegate.then(e=>{if(t)return t(new He(e,this,this._ref))},e)}on(e,t,r,s){let n=void 0;return t&&(n="function"==typeof t?e=>t(new He(e,this,this._ref)):{next:t.next?e=>t.next(new He(e,this,this._ref)):void 0,complete:t.complete||void 0,error:t.error||void 0}),this._delegate.on(e,n,r||void 0,s||void 0)}}class We{constructor(e,t){this._delegate=e,this._service=t}get prefixes(){return this._delegate.prefixes.map(e=>new Ve(e,this._service))}get items(){return this._delegate.items.map(e=>new Ve(e,this._service))}get nextPageToken(){return this._delegate.nextPageToken||null}}class Ve{constructor(e,t){this._delegate=e,this.storage=t}get name(){return this._delegate.name}get bucket(){return this._delegate.bucket}get fullPath(){return this._delegate.fullPath}toString(){return this._delegate.toString()}child(e){var t=Oe(this._delegate,e);return new Ve(t,this.storage)}get root(){return new Ve(this._delegate.root,this.storage)}get parent(){var e=this._delegate.parent;return null==e?null:new Ve(e,this.storage)}put(e,t){return this._throwIfRoot("put"),new $e(qe(this._delegate,e,t),this)}putString(e,t=L.RAW,r){this._throwIfRoot("putString");var s=F(t,e);const n=Object.assign({},r);return null==n.contentType&&null!=s.contentType&&(n.contentType=s.contentType),new $e(new ke(this._delegate,new $(s.data,!0),n),this)}listAll(){return Ce(_(this._delegate)).then(e=>new We(e,this.storage))}list(e){return t=this._delegate,e=e||void 0,Ee(t=_(t),e).then(e=>new We(e,this.storage));var t}getMetadata(){return Fe(this._delegate)}updateMetadata(e){return xe(_(this._delegate),e)}getDownloadURL(){return Ae(_(this._delegate))}delete(){return this._throwIfRoot("delete"),Ue(_(this._delegate))}_throwIfRoot(e){if(""===this._delegate._location.path)throw k(e)}}class Ge{constructor(e,t){this.app=e,this._delegate=t}get maxOperationRetryTime(){return this._delegate.maxOperationRetryTime}get maxUploadRetryTime(){return this._delegate.maxUploadRetryTime}ref(e){if(Xe(e))throw T("ref() expected a child path but got a URL, use refFromURL instead.");return new Ve(je(this._delegate,e),this)}refFromURL(e){if(!Xe(e))throw T("refFromURL() expected a full URL but got a child path, use ref() instead.");try{E.makeFromUrl(e,this._delegate.host)}catch(e){throw T("refFromUrl() expected a valid full URL but got an invalid one.")}return new Ve(je(this._delegate,e),this)}setMaxUploadRetryTime(e){this._delegate.maxUploadRetryTime=e}setMaxOperationRetryTime(e){this._delegate.maxOperationRetryTime=e}useEmulator(e,t,r={}){var s;[s,e,t,r={}]=[this._delegate,e,t,r],Be(s,e,t,r)}}function Xe(e){return/^[A-Za-z]+:\/\//.test(e)}function Ke(e,{instanceIdentifier:t}){var r=e.getProvider("app-compat").getImmediate(),s=e.getProvider("storage").getImmediate({identifier:t});return new Ge(r,s)}r=n.default,s={TaskState:be,TaskEvent:me,StringFormat:L,Storage:Ge,Reference:Ve},r.INTERNAL.registerComponent(new p("storage-compat",Ke,"PUBLIC").setServiceProps(s).setMultipleInstances(!0)),r.registerVersion("@firebase/storage-compat","0.1.9-canary.88d43ec00")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-storage-compat.js - be sure to load firebase-app.js first.")}});
2
2
  //# sourceMappingURL=firebase-storage-compat.js.map
@@ -1,4 +1,4 @@
1
- import { getApp, _getProvider, _registerComponent, registerVersion, SDK_VERSION } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.044a8d7f9/firebase-app.js';
1
+ import { getApp, _getProvider, _registerComponent, registerVersion, SDK_VERSION } from 'https://www.gstatic.com/firebasejs/9.6.2-canary.88d43ec00/firebase-app.js';
2
2
 
3
3
  /**
4
4
  * @license
@@ -3733,7 +3733,7 @@ class FirebaseStorageImpl {
3733
3733
  }
3734
3734
 
3735
3735
  const name = "@firebase/storage";
3736
- const version = "0.9.1-canary.044a8d7f9";
3736
+ const version = "0.9.1-canary.88d43ec00";
3737
3737
 
3738
3738
  /**
3739
3739
  * @license
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase",
3
- "version": "9.6.2-canary.044a8d7f9",
3
+ "version": "9.6.2-canary.88d43ec00",
4
4
  "description": "Firebase JavaScript library for web and Node.js",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "license": "Apache-2.0",
@@ -219,32 +219,32 @@
219
219
  "test:ci": "echo 'No test suite for firebase wrapper'"
220
220
  },
221
221
  "dependencies": {
222
- "@firebase/app": "0.7.12-canary.044a8d7f9",
223
- "@firebase/app-compat": "0.1.13-canary.044a8d7f9",
224
- "@firebase/app-types": "0.7.0-canary.044a8d7f9",
225
- "@firebase/auth": "0.19.5-canary.044a8d7f9",
226
- "@firebase/auth-compat": "0.2.5-canary.044a8d7f9",
227
- "@firebase/database": "0.12.5-canary.044a8d7f9",
228
- "@firebase/database-compat": "0.1.5-canary.044a8d7f9",
229
- "@firebase/firestore": "3.4.2-canary.044a8d7f9",
230
- "@firebase/firestore-compat": "0.1.11-canary.044a8d7f9",
231
- "@firebase/functions": "0.7.7-canary.044a8d7f9",
232
- "@firebase/functions-compat": "0.1.8-canary.044a8d7f9",
233
- "@firebase/installations": "0.5.5-canary.044a8d7f9",
234
- "@firebase/messaging": "0.9.5-canary.044a8d7f9",
235
- "@firebase/messaging-compat": "0.1.5-canary.044a8d7f9",
222
+ "@firebase/app": "0.7.12-canary.88d43ec00",
223
+ "@firebase/app-compat": "0.1.13-canary.88d43ec00",
224
+ "@firebase/app-types": "0.7.0-canary.88d43ec00",
225
+ "@firebase/auth": "0.19.5-canary.88d43ec00",
226
+ "@firebase/auth-compat": "0.2.5-canary.88d43ec00",
227
+ "@firebase/database": "0.12.5-canary.88d43ec00",
228
+ "@firebase/database-compat": "0.1.5-canary.88d43ec00",
229
+ "@firebase/firestore": "3.4.2-canary.88d43ec00",
230
+ "@firebase/firestore-compat": "0.1.11-canary.88d43ec00",
231
+ "@firebase/functions": "0.7.7-canary.88d43ec00",
232
+ "@firebase/functions-compat": "0.1.8-canary.88d43ec00",
233
+ "@firebase/installations": "0.5.5-canary.88d43ec00",
234
+ "@firebase/messaging": "0.9.5-canary.88d43ec00",
235
+ "@firebase/messaging-compat": "0.1.5-canary.88d43ec00",
236
236
  "@firebase/polyfill": "0.3.36",
237
- "@firebase/storage": "0.9.1-canary.044a8d7f9",
238
- "@firebase/storage-compat": "0.1.9-canary.044a8d7f9",
239
- "@firebase/performance": "0.5.5-canary.044a8d7f9",
240
- "@firebase/performance-compat": "0.1.5-canary.044a8d7f9",
241
- "@firebase/remote-config": "0.3.4-canary.044a8d7f9",
242
- "@firebase/remote-config-compat": "0.1.5-canary.044a8d7f9",
243
- "@firebase/analytics": "0.7.5-canary.044a8d7f9",
244
- "@firebase/analytics-compat": "0.1.6-canary.044a8d7f9",
245
- "@firebase/app-check": "0.5.3-canary.044a8d7f9",
246
- "@firebase/app-check-compat": "0.2.3-canary.044a8d7f9",
247
- "@firebase/util": "1.4.3-canary.044a8d7f9"
237
+ "@firebase/storage": "0.9.1-canary.88d43ec00",
238
+ "@firebase/storage-compat": "0.1.9-canary.88d43ec00",
239
+ "@firebase/performance": "0.5.5-canary.88d43ec00",
240
+ "@firebase/performance-compat": "0.1.5-canary.88d43ec00",
241
+ "@firebase/remote-config": "0.3.4-canary.88d43ec00",
242
+ "@firebase/remote-config-compat": "0.1.5-canary.88d43ec00",
243
+ "@firebase/analytics": "0.7.5-canary.88d43ec00",
244
+ "@firebase/analytics-compat": "0.1.6-canary.88d43ec00",
245
+ "@firebase/app-check": "0.5.3-canary.88d43ec00",
246
+ "@firebase/app-check-compat": "0.2.3-canary.88d43ec00",
247
+ "@firebase/util": "1.4.3-canary.88d43ec00"
248
248
  },
249
249
  "devDependencies": {
250
250
  "rollup": "2.57.0",