1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62733,97201,8135,83439,e=>{"use strict";let t,r,n;var i,s,a,o,l,c,h,u=e.i(47167);let d=function(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:((64512&i)==55296&&n+1<e.length&&(64512&e.charCodeAt(n+1))==56320?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128):t[r++]=i>>12|224,t[r++]=i>>6&63|128),t[r++]=63&i|128)}return t},p=function(e){let t=[],r=0,n=0;for(;r<e.length;){let i=e[r++];if(i<128)t[n++]=String.fromCharCode(i);else if(i>191&&i<224){let s=e[r++];t[n++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){let s=((7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else{let s=e[r++],a=e[r++];t[n++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}}return t.join("")},f={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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();let r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let t=0;t<e.length;t+=3){let i=e[t],s=t+1<e.length,a=s?e[t+1]:0,o=t+2<e.length,l=o?e[t+2]:0,c=i>>2,h=(3&i)<<4|a>>4,u=(15&a)<<2|l>>6,d=63&l;!o&&(d=64,s||(u=64)),n.push(r[c],r[h],r[u],r[d])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(d(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):p(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let t=0;t<e.length;){let i=r[e.charAt(t++)],s=t<e.length?r[e.charAt(t)]:0,a=++t<e.length?r[e.charAt(t)]:64,o=++t<e.length?r[e.charAt(t)]:64;if(++t,null==i||null==s||null==a||null==o)throw new m;let l=i<<2|s>>4;if(n.push(l),64!==a){let e=s<<4&240|a>>2;if(n.push(e),64!==o){let e=a<<6&192|o;n.push(e)}}}return n},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)}}};class m extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}let g=function(e){let t=d(e);return f.encodeByteArray(t,!0)},_=function(e){return g(e).replace(/\./g,"")},v=function(e){try{return f.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function y(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(let r in t)t.hasOwnProperty(r)&&"__proto__"!==r&&(e[r]=y(e[r],t[r]));return e}function w(){return"u">typeof self?self:"u">typeof window?window:e.g}let I=()=>{try{return w().__FIREBASE_DEFAULTS__||(()=>{if(void 0===u.default||void 0===u.default.env)return;let e=u.default.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)})()||(()=>{let e;if("u"<typeof document)return;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}let t=e&&v(e[1]);return t&&JSON.parse(t)})()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},b=()=>I()?.config;class T{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,r))}}}function E(){return"u">typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function k(){let t=I()?.forceEnvironment;if("node"===t)return!0;
1if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(e.g.process)}catch(e){return!1}}function R(){return"u">typeof WorkerGlobalScope&&"u">typeof self&&self instanceof WorkerGlobalScope}function S(){let e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function A(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function C(){let e=E();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function P(){try{return"object"==typeof indexedDB}catch(e){return!1}}class O extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,O.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,N.prototype.create)}}class N{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){var r,n;let i=t[0]||{},s=`${this.service}/${e}`,a=this.errors[e],o=a?(r=a,n=i,r.replace(D,(e,t)=>{let r=n[t];return null!=r?String(r):`<${t}?>`})):"Error",l=`${this.serviceName}: ${o} (${s}).`;return new O(s,l,i)}}let D=/\{\$([^}]+)}/g;function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function U(e,t){if(e===t)return!0;let r=Object.keys(e),n=Object.keys(t);for(let i of r){if(!n.includes(i))return!1;let r=e[i],s=t[i];if(M(r)&&M(s)){if(!U(r,s))return!1}else if(r!==s)return!1}for(let e of n)if(!r.includes(e))return!1;return!0}function M(e){return null!==e&&"object"==typeof e}function x(e){let t=[];for(let[r,n]of Object.entries(e))Array.isArray(n)?n.forEach(e=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return t.length?"&"+t.join("&"):""}function F(e){let t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){let[r,n]=e.split("=");
1t[decodeURIComponent(r)]=decodeURIComponent(n)}}),t}function V(e){let t=e.indexOf("?");if(!t)return"";let r=e.indexOf("#",t);return e.substring(t,r>0?r:void 0)}function H(e,t){let r=new j(e,t);return r.subscribe.bind(r)}class j{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let n;if(void 0===e&&void 0===t&&void 0===r)throw Error("Missing Observer.");void 0===(n=!function(e,t){if("object"!=typeof e||null===e)return!1;for(let r of t)if(r in e&&"function"==typeof e[r])return!0;return!1}(e,["next","error","complete"])?{next:e,error:t,complete:r}:e).next&&(n.next=B),void 0===n.error&&(n.error=B),void 0===n.complete&&(n.complete=B);let i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?n.error(this.finalError):n.complete()}catch(e){}}),this.observers.push(n),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"u">typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function B(){}function W(e){return e&&e._delegate?e._delegate:e}function z(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function q(e){return(await fetch(e,{credentials:"include"})).ok}class ${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}}let G="[DEFAULT]";class K{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new T;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&e.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){let t=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(r)return null;throw e}if(r)return null;throw Error(`Service ${this.name} is not available`)}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if("EAGER"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:G})}catch(e){}for(let[e,t]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:r});t.resolve(e)}catch(e){}}}}clearInstance(e=G){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=G){return this.instances.has(e)}getOptions(e=G){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let n=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[e,t]of this.instancesDeferred.entries())r===this.normalizeInstanceIdentifier(e)&&t.resolve(n);return n}onInit(e,t){let r=this.normalizeInstanceIdentifier(t),n=this.onInitCallbacks.get(r)??new Set;n.add(e),this.onInitCallbacks.set(r,n);let i=this.instances.get(r);return i&&e(i,r),()=>{n.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let n of r)try{n(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){var r;let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e)===G?void 0:r,options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}return n||null}normalizeInstanceIdentifier(e=G){return this.component?this.component.multipleInstances?e:G:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class J{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new K(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}let Y=[];(i=l||(l={}))[i.DEBUG=0]="DEBUG",i[i.VERBOSE=1]="VERBOSE",i[i.INFO=2]="INFO",i[i.WARN=3]="WARN",i[i.ERROR=4]="ERROR",i[i.SILENT=5]="SILENT";let X={debug:l.DEBUG,verbose:l.VERBOSE,info:l.INFO,warn:l.WARN,error:l.ERROR,silent:l.SILENT},Z=l.INFO,Q={[l.DEBUG]:"log",[l.VERBOSE]:"log",[l.INFO]:"info",[l.WARN]:"warn",[l.ERROR]:"error"},ee=(e,t,...r)=>{if(t<e.logLevel)return;let n=new Date().toISOString(),i=Q[t];if(i)console[i](`[${n}] ${e.name}:`,...r);
1else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class et{constructor(e){this.name=e,this._logLevel=Z,this._logHandler=ee,this._userLogHandler=null,Y.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in l))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?X[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,l.DEBUG,...e),this._logHandler(this,l.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,l.VERBOSE,...e),this._logHandler(this,l.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,l.INFO,...e),this._logHandler(this,l.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,l.WARN,...e),this._logHandler(this,l.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,l.ERROR,...e),this._logHandler(this,l.ERROR,...e)}}let er=new WeakMap,en=new WeakMap,ei=new WeakMap,es=new WeakMap,ea=new WeakMap,eo={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return en.get(e);if("objectStoreNames"===t)return e.objectStoreNames||ei.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return el(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function el(e){if(e instanceof IDBRequest){let t;return(t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(el(e.result)),n()},s=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",s)})).then(t=>{t instanceof IDBCursor&&er.set(t,e)}).catch(()=>{}),ea.set(t,e),t}if(es.has(e))return es.get(e);let n=function(e){if("function"==typeof e)return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(ec(this),t),el(er.get(this))}:function(...t){return el(e.apply(ec(this),t))}:function(t,...r){let n=e.call(ec(this),t,...r);return ei.set(n,t.sort?t.sort():[t]),el(n)};return e instanceof IDBTransaction&&function(e){if(en.has(e))return;let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),n()},s=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});en.set(e,t)}(e),(t||(t=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(e,eo):e}(e);return n!==e&&(es.set(e,n),ea.set(n,e)),n}let ec=e=>ea.get(e),eh=["get","getKey","getAll","getAllKeys","count"],eu=["put","add","delete","clear"],ed=new Map;function ep(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(ed.get(t))return ed.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,i=eu.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||eh.includes(r)))return;let s=async function(e,...t){let s=this.transaction(e,i?"readwrite":"readonly"),a=s.store;return n&&(a=a.index(t.shift())),(await Promise.all([a[r](...t),i&&s.done]))[0]};return ed.set(t,s),s}eo={...n=eo,get:(e,t,r)=>ep(e,t)||n.get(e,t,r),has:(e,t)=>!!ep(e,t)||n.has(e,t)};class ef{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{let t;if(t=e.getComponent(),t?.type!=="VERSION")return null;{let t=e.getImmediate();return`${t.library}/${t.version}`}}).filter(e=>e).join(" ")}}let em="@firebase/app",eg="0.14.12",e_=new et("@firebase/app"),ev="[DEFAULT]",ey={[em]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/data-connect":"fire-data-connect","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/ai":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},ew=new Map,eI=new Map,eb=new Map;function eT(e,t){try{e.container.addComponent(t)}catch(r){e_.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function eE(e,t){e.container.addOrOverwriteComponent(t)}function ek(e){let t=e.name;if(eb.has(t))return e_.debug(`There were multiple attempts to register component ${t}.`),!1;
1for(let r of(eb.set(t,e),ew.values()))eT(r,e);for(let t of eI.values())eT(t,e);return!0}function eR(e,t){let r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function eS(e,t,r=ev){eR(e,t).clearInstance(r)}function eA(e){return void 0!==e.options}function eC(e){return!eA(e)&&("authIdToken"in e||"appCheckToken"in e||"releaseOnDeref"in e||"automaticDataCollectionEnabled"in e)}function eP(e){return null!=e&&void 0!==e.settings}function eO(){eb.clear()}let eN=new N("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
1d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class eD{constructor(e,t,r){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new $("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw eN.create("app-deleted",{appName:this._name})}}function eL(e,t){let r=v(e.split(".")[1]);null===r?console.error(`FirebaseServerApp ${t} is invalid: second part could not be parsed.`):void 0===JSON.parse(r).exp?console.error(`FirebaseServerApp ${t} is invalid: expiration claim could not be parsed`):1e3*JSON.parse(r).exp-new Date().getTime()<=0&&console.error(`FirebaseServerApp ${t} is invalid: the token has expired.`)}class eU extends eD{constructor(e,t,r,n){const i=void 0===t.automaticDataCollectionEnabled||t.automaticDataCollectionEnabled,s={name:r,automaticDataCollectionEnabled:i};void 0!==e.apiKey?super(e,s,n):super(e.options,s,n),this._serverConfig={automaticDataCollectionEnabled:i,...t},this._serverConfig.authIdToken&&eL(this._serverConfig.authIdToken,"authIdToken"),this._serverConfig.appCheckToken&&eL(this._serverConfig.appCheckToken,"appCheckToken"),this._finalizationRegistry=null,"u">typeof FinalizationRegistry&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,t.releaseOnDeref=void 0,eB(em,eg,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,void 0!==e&&null!==this._finalizationRegistry&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){ej(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw eN.create("server-app-deleted")}}let eM="12.13.0";function ex(e,t={}){let r=e;"object"!=typeof t&&(t={name:t});let n={name:ev,automaticDataCollectionEnabled:!0,...t},i=n.name;if("string"!=typeof i||!i)throw eN.create("bad-app-name",{appName:String(i)});if(r||(r=b()),!r)throw eN.create("no-options");let s=ew.get(i);if(s)if(U(r,s.options)&&U(n,s.config))return s;else throw eN.create("duplicate-app",{appName:i});let a=new J(i);for(let e of eb.values())a.addComponent(e);let o=new eD(r,n,a);return ew.set(i,o),o}function eF(e,t={}){let r;if(("u">typeof window||R())&&!R())throw eN.create("invalid-server-app-environment");let n=t||{};if(e&&(eA(e)?r=e.options:eC(e)?n=e:r=e),void 0===n.automaticDataCollectionEnabled&&(n.automaticDataCollectionEnabled=!0),r||(r=b()),!r)throw eN.create("no-options");let i={...n,...r};if(void 0!==i.releaseOnDeref&&delete i.releaseOnDeref,void 0!==n.releaseOnDeref&&"u"<typeof FinalizationRegistry)throw eN.create("finalization-registry-not-supported",{});let s=""+[...JSON.stringify(i)].reduce((e,t)=>Math.imul(31,e)+t.charCodeAt(0)|0,0),a=eI.get(s);if(a)return a.incRefCount(n.releaseOnDeref),a;let o=new J(s);for(let e of eb.values())o.addComponent(e);let l=new eU(r,n,s,o);return eI.set(s,l),l}function eV(e=ev){let t=ew.get(e);if(!t&&e===ev&&b())return ex();if(!t)throw eN.create("no-app",{appName:e});return t}function eH(){return Array.from(ew.values())}async function ej(e){let t=!1,r=e.name;ew.has(r)?(t=!0,ew.delete(r)):eI.has(r)&&0>=e.decRefCount()&&(eI.delete(r),t=!0),t&&(await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function eB(e,t,r){let n=ey[e]??e;r&&(n+=`-${r}`);let i=n.match(/\s|\//),s=t.match(/\s|\//);if(i||s){let e=[`Unable to register library "${n}" with version "${t}":`];i&&e.push(`library name "${n}" contains illegal characters (whitespace or "/")`),i&&s&&e.push("and"),s&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),e_.warn(e.join(" "));return}ek(new $(`${n}-version`,()=>({library:n,version:t}),"VERSION"))}function eW(e,t){if(null!==e&&"function"!=typeof e)throw eN.create("invalid-log-argument");for(let r of Y){let n=null;t&&t.level&&(n=X[t.level]),null===e?r.userLogHandler=null:r.userLogHandler=(t,r,...i)=>{let s=i.map(e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(e=>e).join(" ");r>=(n??t.logLevel)&&e({level:l[r].toLowerCase(),message:s,args:i,type:t.name})}}}function ez(e){Y.forEach(t=>{t.setLogLevel(e)}
1)}let eq="firebase-heartbeat-store",e$=null;function eG(){return e$||(e$=(function(e,{blocked:t,upgrade:r,blocking:n,terminated:i}={}){let s=indexedDB.open(e,1),a=el(s);return r&&s.addEventListener("upgradeneeded",e=>{r(el(s.result),e.oldVersion,e.newVersion,el(s.transaction),e)}),t&&s.addEventListener("blocked",e=>t(e.oldVersion,e.newVersion,e)),a.then(e=>{i&&e.addEventListener("close",()=>i()),n&&e.addEventListener("versionchange",e=>n(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a})("firebase-heartbeat-database",{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(eq)}catch(e){console.warn(e)}}}).catch(e=>{throw eN.create("idb-open",{originalErrorMessage:e.message})})),e$}async function eK(e){try{let t=(await eG()).transaction(eq),r=await t.objectStore(eq).get(eY(e));return await t.done,r}catch(e){if(e instanceof O)e_.warn(e.message);else{let t=eN.create("idb-get",{originalErrorMessage:e?.message});e_.warn(t.message)}}}async function eJ(e,t){try{let r=(await eG()).transaction(eq,"readwrite"),n=r.objectStore(eq);await n.put(t,eY(e)),await r.done}catch(e){if(e instanceof O)e_.warn(e.message);else{let t=eN.create("idb-set",{originalErrorMessage:e?.message});e_.warn(t.message)}}}function eY(e){return`${e.name}!${e.options.appId}`}class eX{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new eQ(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{let e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=eZ();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>30){let e=function(e){if(0===e.length)return -1;let t=0,r=e[0].date;for(let n=1;n<e.length;n++)e[n].date<r&&(r=e[n].date,t=n);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){e_.warn(e)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||0===this._heartbeatsCache.heartbeats.length)return"";let e=eZ(),{heartbeatsToSend:t,unsentEntries:r}=function(e,t=1024){let r=[],n=e.slice();for(let i of e){let e=r.find(e=>e.agent===i.agent);if(e){if(e.dates.push(i.date),e0(r)>t){e.dates.pop();break}}else if(r.push({agent:i.agent,dates:[i.date]}),e0(r)>t){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}(this._heartbeatsCache.heartbeats),n=_(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),n}catch(e){return e_.warn(e),""}}}function eZ(){return new Date().toISOString().substring(0,10)}class eQ{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!P()&&new Promise((e,t)=>{try{let r=!0,n="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(n);i.onsuccess=()=>{i.result.close(),r||self.indexedDB.deleteDatabase(n),e(!0)},i.onupgradeneeded=()=>{r=!1},i.onerror=()=>{t(i.error?.message||"")}}catch(e){t(e)}}).then(()=>!0).catch(()=>!1)}async read(){if(!await this._canUseIndexedDBPromise)return{heartbeats:[]};{let e=await eK(this.app);return e?.heartbeats?e:{heartbeats:[]}}}async overwrite(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return eJ(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return eJ(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}}function e0(e){return _(JSON.stringify({version:2,heartbeats:e})).length}ek(new $("platform-logger",e=>new ef(e),"PRIVATE")),ek(new $("heartbeat",e=>new eX(e),"PRIVATE")),eB(em,eg,""),eB(em,eg,"esm2020"),eB("fire-js",""),e.s(["SDK_VERSION",0,eM,"_DEFAULT_ENTRY_NAME",0,ev,"_addComponent",0,eT,"_addOrOverwriteComponent",0,eE,"_apps",0,ew,"_clearComponents",0,eO,"_components",0,eb,"_getProvider",0,eR,"_isFirebaseApp",0,eA,"_isFirebaseServerApp",0,eP,"_isFirebaseServerAppSettings",0,eC,"_registerComponent",0,ek,"_removeServiceInstance",0,eS,"_serverApps",0,eI,"deleteApp",0,ej,"getApp",0,eV,"getApps",0,eH,"initializeApp",0,ex,"initializeServerApp",0,eF,"onLog",0,eW,"registerVersion",0,eB,"setLogLevel",0,ez],92953),e.i(92953),e.s(["FirebaseError",0,O,"SDK_VERSION",0,eM,"_DEFAULT_ENTRY_NAME",0,ev,"_addComponent",0,eT,"_addOrOverwriteComponent",0,eE,"_apps",0,ew,"_clearComponents",0,eO,"_components",0,eb,"_getProvider",0,eR,"_isFirebaseApp",0,eA,"_isFirebaseServerApp",0,eP,"_isFirebaseServerAppSettings",0,eC,"_registerComponent",0,ek,"_removeServiceInstance",0,eS,"_serverApps",0,eI,"deleteApp",0,ej,"getApp",0,eV,"getApps",0,eH,"initializeApp",0,ex,"initializeServerApp",0,eF,"onLog",0,eW,"registerVersion",0,eB,"setLogLevel",0,ez],76510);var e1=e.i(76510);class e2{constructor(e,t){this._delegate=e,this.firebase=t,eT(e,new $("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),ej(this._delegate)))}_getService(e,t=ev){this._delegate.checkDestroyed();let r=this._delegate.container.getProvider(e);return r.isInitialized()||r.getComponent()?.instantiationMode!=="EXPLICIT"||r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=ev){this._delegate.container.getProvider(e).
1clearInstance(t)}_addComponent(e){eT(this._delegate,e)}_addOrOverwriteComponent(e){eE(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}}let e6=new N("app-compat","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."}),e3=function e(){let t=function(e){let t={},r={__esModule:!0,initializeApp:function(n,i={}){let s=ex(n,i);if(L(t,s.name))return t[s.name];let a=new e(s,r);return t[s.name]=a,a},app:n,registerVersion:eB,setLogLevel:ez,onLog:eW,apps:null,SDK_VERSION:eM,INTERNAL:{registerComponent:function(t){let i=t.name,s=i.replace("-compat","");if(ek(t)&&"PUBLIC"===t.type){let a=(e=n())=>{if("function"!=typeof e[s])throw e6.create("invalid-app-argument",{appName:i});return e[s]()};void 0!==t.serviceProps&&y(a,t.serviceProps),r[s]=a,e.prototype[s]=function(...e){return this._getService.bind(this,i).apply(this,t.multipleInstances?e:[])}}return"PUBLIC"===t.type?r[s]:null},removeApp:function(e){delete t[e]},useAsService:function(e,t){return"serverAuth"===t?null:t},modularAPIs:e1}};function n(e){if(!L(t,e=e||ev))throw e6.create("no-app",{appName:e});return t[e]}return r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(t).map(e=>t[e])}}),n.App=e,r}(e2);return t.INTERNAL={...t.INTERNAL,createFirebaseNamespace:e,extendNamespace:function(e){y(t,e)},createSubscribe:H,ErrorFactory:N,deepExtend:y},t}(),e4=new et("@firebase/app-compat");try{let e=w();if(void 0!==e.firebase){e4.warn(` 2 Warning: Firebase is already defined in the global scope. Please make sure 3 Firebase library is only loaded once. 4 `);let t=e.firebase.SDK_VERSION;t&&t.indexOf("LITE")>=0&&e4.warn(` 5 Warning: You are trying to load Firebase while using Firebase Performance standalone script. 6 You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code. 7 `)}}catch{}eB("@firebase/app-compat","0.5.12",void 0),e.s(["default",0,e3],97201),e3.registerVersion("firebase","12.13.0","app-compat"),e.s([],8135);function e5(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}let e8=function
vendor: 12,061 bytes, line 7
7(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements.","invalid-hosting-link-domain":"The provided Hosting link domain is not configured in Firebase Hosting or is not owned by the current project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`)."}}
7,e9=new N("auth","Firebase",e5()),e7=new et("@firebase/auth");function te(e,...t){e7.logLevel<=l.ERROR&&e7.error(`Auth (${eM}): ${e}`,...t)}function tt(e,...t){throw ta(e,...t)}function tr(e,...t){return ta(e,...t)}function tn(e,t,r){return new N("auth","Firebase",{...e5(),[t]:r}).create(t,{appName:e.name})}function ti(e){return tn(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ts(e,t,r){if(!(t instanceof r))throw r.name!==t.constructor.name&&tt(e,"argument-error"),tn(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function ta(e,...t){if("string"!=typeof e){let r=t[0],n=[...t.slice(1)];return n[0]&&(n[0].appName=e.name),e._errorFactory.create(r,...n)}return e9.create(e,...t)}function to(e,t,...r){if(!e)throw ta(t,...r)}function tl(e){let t="INTERNAL ASSERTION FAILED: "+e;throw te(t),Error(t)}function tc(){return"u">typeof self&&self.location?.href||""}function th(){return"http:"===tu()||"https:"===tu()}function tu(){return"u">typeof self&&self.location?.protocol||null}class td{constructor(e,t){this.shortDelay=e,this.longDelay=t,function(e,t){e||tl(t)}(t>e,"Short delay should be less than long delay!"),this.isMobile="u">typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(E())||A()}get(){return!("u">typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(th()||S()||"connection"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function tp(e,t){var r,n;r=e.emulator,n="Emulator should always be set here",r||tl(n);let{url:i}=e.emulator;return t?`${i}${t.startsWith("/")?t.slice(1):t}`:i}class tf{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){return this.fetchImpl?this.fetchImpl:"u">typeof self&&"fetch"in self?self.fetch:"u">typeof globalThis&&globalThis.fetch?globalThis.fetch:"u">typeof fetch?fetch:void tl("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"u">typeof self&&"Headers"in self?self.Headers:"u">typeof globalThis&&globalThis.Headers?globalThis.Headers:"u">typeof Headers?Headers:void tl("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"u">typeof self&&"Response"in self?self.Response:"u">typeof globalThis&&globalThis.Response?globalThis.Response:"u">typeof Response?Response:void tl("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}let tm={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVA
7LID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},tg=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],t_=new td(3e4,6e4);function tv(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function ty(e,t,r,n,i={}){return tw(e,i,async()=>{let i={},s={};n&&("GET"===t?s=n:i={body:JSON.stringify(n)});let a=x({key:e.config.apiKey,...s}).slice(1),o=await e._getAdditionalHeaders();o["Content-Type"]="application/json",e.languageCode&&(o["X-Firebase-Locale"]=e.languageCode);let l={method:t,headers:o,...i};return"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(l.referrerPolicy="no-referrer"),e.emulatorConfig&&z(e.emulatorConfig.host)&&(l.credentials="include"),tf.fetch()(await tb(e,e.config.apiHost,r,a),l)})}async function tw(e,t,r){e._canInitEmulator=!1;let n={...tm,...t};try{let t=new tT(e),i=await Promise.race([r(),t.promise]);t.clearNetworkTimeout();let s=await i.json();if("needConfirmation"in s)throw tE(e,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{let[t,r]=(i.ok?s.errorMessage:s.error.message).split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===t)throw tE(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===t)throw tE(e,"email-already-in-use",s);if("USER_DISABLED"===t)throw tE(e,"user-disabled",s);let a=n[t]||t.toLowerCase().replace(/[_\s]+/g,"-");if(r)throw tn(e,a,r);tt(e,a)}}catch(t){if(t instanceof O)throw t;tt(e,"network-request-failed",{message:String(t)})}}async function tI(e,t,r,n,i={}){let s=await ty(e,t,r,n,i);return"mfaPendingCredential"in s&&tt(e,"multi-factor-auth-required",{_serverResponse:s}),s}async function tb(e,t,r,n){let i=`${t}${r}?${n}`,s=e.config.emulator?tp(e.config,i):`${e.config.apiScheme}://${i}`;return tg.includes(r)&&(await e._persistenceManagerAvailable,"COOKIE"===e._getPersistenceType())?e._getPersistence()._getFinalTarget(s).toString():s}class tT{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>
7{this.timer=setTimeout(()=>t(tr(this.auth,"network-request-failed")),t_.get())})}}function tE(e,t,r){let n={appName:e.name};r.email&&(n.email=r.email),r.phoneNumber&&(n.phoneNumber=r.phoneNumber);let i=tr(e,t,n);return i.customData._tokenResponse=r,i}function tk(e){return void 0!==e&&void 0!==e.getResponse}function tR(e){return void 0!==e&&void 0!==e.enterprise}class tS{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)switch(t.enforcementState){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function tA(e){return(await ty(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function tC(e,t){return ty(e,"GET","/v2/recaptchaConfig",tv(e,t))}async function tP(e,t){return ty(e,"POST","/v1/accounts:delete",t)}async function tO(e,t){return ty(e,"POST","/v1/accounts:update",t)}async function tN(e,t){return ty(e,"POST","/v1/accounts:lookup",t)}function tD(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}async function tL(e,t=!1){let r=W(e),n=await r.getIdToken(t),i=tM(n);to(i&&i.exp&&i.auth_time&&i.iat,r.auth,"internal-error");let s="object"==typeof i.firebase?i.firebase:void 0,a=s?.sign_in_provider;return{claims:i,token:n,authTime:tD(tU(i.auth_time)),issuedAtTime:tD(tU(i.iat)),expirationTime:tD(tU(i.exp)),signInProvider:a||null,signInSecondFactor:s?.sign_in_second_factor||null}}function tU(e){return 1e3*Number(e)}function tM(e){let[t,r,n]=e.split(".");if(void 0===t||void 0===r||void 0===n)return te("JWT malformed, contained fewer than 3 sections"),null;try{let e=v(r);if(!e)return te("Failed to decode base64 JWT payload"),null;return JSON.parse(e)}catch(e){return te("Caught error parsing JWT payload as JSON",e?.toString()),null}}function tx(e){let t=tM(e);return to(t,"internal-error"),to(void 0!==t.exp,"internal-error"),to(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function tF(e,t,r=!1){if(r)return t;try{return await t}catch(t){throw t instanceof O&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class tV{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(!e)return this.errorBackoff=3e4,Math.max(0,(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5);{let e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}class tH{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=tD(this.lastLoginAt),this.creationTime=tD(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function tj(e){var t,r;let n=e.auth,i=await e.getIdToken(),s=await tF(e,tN(n,{idToken:i}));to(s?.users.length,n,"internal-error");let a=s.users[0];e._notifyReloadListener(a);let o=a.providerUserInfo?.length?tW(a.providerUserInfo):[],l=(t=e.providerData,r=o,[...t.filter(e=>!r.some(t=>t.providerId===e.providerId)),...r]),c=e.isAnonymous,h=!(e.email&&a.passwordHash)&&!l?.length;Object.assign(e,{uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:l,metadata:new tH(a.createdAt,a.lastLoginAt),isAnonymous:!!c&&h})}async function tB(e){let t=W(e);await tj(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function tW(e){return e.map(({providerId:e,...t})=>
7({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}async function tz(e,t){let r=await tw(e,{},async()=>{let r=x({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:n,apiKey:i}=e.config,s=await tb(e,n,"/v1/token",`key=${i}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";let o={method:"POST",headers:a,body:r};return e.emulatorConfig&&z(e.emulatorConfig.host)&&(o.credentials="include"),tf.fetch()(s,o)});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function tq(e,t){return ty(e,"POST","/v2/accounts:revokeToken",tv(e,t))}class t${constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){to(e.idToken,"internal-error"),to(void 0!==e.idToken,"internal-error"),to(void 0!==e.refreshToken,"internal-error");let t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):tx(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){to(0!==e.length,"internal-error");let t=tx(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(to(this.refreshToken,e,"user-token-expired"),this.refreshToken)?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:r,refreshToken:n,expiresIn:i}=await tz(e,t);this.updateTokensAndExpiration(r,n,Number(i))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*r}static fromJSON(e,t){let{refreshToken:r,accessToken:n,expirationTime:i}=t,s=new t$;return r&&(to("string"==typeof r,"internal-error",{appName:e}),s.refreshToken=r),n&&(to("string"==typeof n,"internal-error",{appName:e}),s.accessToken=n),i&&(to("number"==typeof i,"internal-error",{appName:e}),s.expirationTime=i),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new t$,this.toJSON())}_performRefresh(){return tl("not implemented")}}function tG(e,t){to("string"==typeof e||void 0===e,"internal-error",{appName:t})}class tK{constructor({uid:e,auth:t,stsTokenManager:r,...n}){this.providerId="firebase",this.proactiveRefresh=new tV(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=n.displayName||null,this.email=n.email||null,this.emailVerified=n.emailVerified||!1,this.phoneNumber=n.phoneNumber||null,this.photoURL=n.photoURL||null,this.isAnonymous=n.isAnonymous||!1,this.tenantId=n.tenantId||null,this.providerData=n.providerData?[...n.providerData]:[],this.metadata=new tH(n.createdAt||void 0,n.lastLoginAt||void 0)}async getIdToken(e){let t=await tF(this,this.stsTokenManager.getToken(this.auth,e));return to(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return tL(this,e)}reload(){return tB(this)}_assign(e){this!==e&&(to(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>({...e})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new tK({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){to(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await tj(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(eP(this.auth.app))return Promise.reject(ti(this.auth));let e=await this.getIdToken();return await tF(this,tP(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
7nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){let r=t.displayName??void 0,n=t.email??void 0,i=t.phoneNumber??void 0,s=t.photoURL??void 0,a=t.tenantId??void 0,o=t._redirectEventId??void 0,l=t.createdAt??void 0,c=t.lastLoginAt??void 0,{uid:h,emailVerified:u,isAnonymous:d,providerData:p,stsTokenManager:f}=t;to(h&&f,e,"internal-error");let m=t$.fromJSON(this.name,f);to("string"==typeof h,e,"internal-error"),tG(r,e.name),tG(n,e.name),to("boolean"==typeof u,e,"internal-error"),to("boolean"==typeof d,e,"internal-error"),tG(i,e.name),tG(s,e.name),tG(a,e.name),tG(o,e.name),tG(l,e.name),tG(c,e.name);let g=new tK({uid:h,auth:e,email:n,emailVerified:u,displayName:r,isAnonymous:d,photoURL:s,phoneNumber:i,tenantId:a,stsTokenManager:m,createdAt:l,lastLoginAt:c});return p&&Array.isArray(p)&&(g.providerData=p.map(e=>({...e}))),o&&(g._redirectEventId=o),g}static async _fromIdTokenResponse(e,t,r=!1){let n=new t$;n.updateFromServerResponse(t);let i=new tK({uid:t.localId,auth:e,stsTokenManager:n,isAnonymous:r});return await tj(i),i}static async _fromGetAccountInfoResponse(e,t,r){let n=t.users[0];to(void 0!==n.localId,"internal-error");let i=void 0!==n.providerUserInfo?tW(n.providerUserInfo):[],s=!(n.email&&n.passwordHash)&&!i?.length,a=new t$;a.updateFromIdToken(r);let o=new tK({uid:n.localId,auth:e,stsTokenManager:a,isAnonymous:s});return Object.assign(o,{uid:n.localId,displayName:n.displayName||null,photoURL:n.photoUrl||null,email:n.email||null,emailVerified:n.emailVerified||!1,phoneNumber:n.phoneNumber||null,tenantId:n.tenantId||null,providerData:i,metadata:new tH(n.createdAt,n.lastLoginAt),isAnonymous:!(n.email&&n.passwordHash)&&!i?.length}),o}}let tJ=new Map;function tY(e){var t,r;t="Expected a class definition",e instanceof Function||tl(t);let n=tJ.get(e);return n?(r="Instance stored in cache mismatched with class",n instanceof e||tl(r)):(n=new e,tJ.set(e,n)),n}class tX{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}function tZ(e,t,r){return`firebase:${e}:${t}:${r}`}tX.type="NONE";class tQ{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:n,name:i}=this.auth;this.fullUserKey=tZ(this.userKey,n.apiKey,i),this.fullPersistenceKey=tZ("persistence",n.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"==typeof e){let t=await tN(this.auth,{idToken:e}).catch(()=>void 0);return t?tK._fromGetAccountInfoResponse(this.auth,t,e):null}return tK._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new tQ(tY(tX),e,r);let n=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),i=n[0]||tY(tX),s=tZ(r,e.config.apiKey,e.name),a=null;for(let r of t)try{let t=await r._get(s);if(t){let n;if("string"==typeof t){let r=await tN(e,{idToken:t}).catch(()=>void 0);if(!r)break;n=await tK._fromGetAccountInfoResponse(e,r,t)}else n=tK._fromJSON(e,t);r!==i&&(a=n),i=r;break}}catch{}let o=n.filter(e=>e._shouldAllowMigration);return i._shouldAllowMigration&&o.length&&(i=o[0],a&&await i._set(s,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==i)try{await e._remove(s)}catch{}}))),new tQ(i,e,r)}}function t0(e){let t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";{if(t3(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(t1(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(t5(t))return"Blackberry";if(t8(t))return"Webos";if(t2(t))return"Safari";if((t.includes("chrome/")||t6(t))&&!t.includes("edge/"))return"Chrome";if(t4(t))return"Android";let r=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(r?.length===2)return r[1]}return"Other"}function t1(e=E()){return/firefox\//i.test(e)}function t2(e=E()){let t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function t6(e=E()){return/crios\//i.test(e)}function t3(e=E()){return/iemobile/i.test(e)}function t4(e=E()){return/android/i.test(e)}function t5(e=E()){return/blackberry/i.test(e)}function t8(e=E()){return/webos/i.test(e)}function t9(e=E()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function t7(e=E()){return t9(e)||t4(e)||t8(e)||t5(e)||/windows phone/i.test(e)||t3(e)}function re(e,t=[]){let r;switch(e){case"Browser":r=t0(E());break;case"Worker":r=`${t0(E())}-${e}`;break;default:r=e}let n=t.length?t.join(","):"FirebaseCore-web";return`${r}/JsCore/${eM}/${n}`}class rt{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let r=t=>new Promise((r,n)=>{try{let n=e(t);r(n)}catch(e){n(e)}});r.onAbort=t,this.queue.push(r);let n=this.queue.length-1;return()=>{this.queue[n]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(e){for(let e of(t.reverse(),t))try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:e?.message})}}}async function rr(e,t={}){return ty(e,"GET","/v2/passwordPolicy",tv(e,t))}class rn{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??6,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),void 0!==t.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),void 0!==t.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),void 0!==t.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),void 0!==t.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){let t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&
7(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){let r=this.customStrengthOptions.minPasswordLength,n=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),n&&(t.meetsMaxPasswordLength=e.length<=n)}validatePasswordCharacterOptions(e,t){let r;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let n=0;n<e.length;n++)r=e.charAt(n),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,n,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=n)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class ri{constructor(e,t,r,n){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new rs(this),this.idTokenSubscription=new rs(this),this.beforeStateQueue=new rt(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=e9,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=n.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=tY(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted){if(this.persistenceManager=await tQ.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(this.currentUser||e){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{let t=await tN(this,{idToken:e}),r=await tK._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(eP(this.app)){let e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}let t=await this.assertedPersistence.getCurrentUser(),r=t,n=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let t=this.redirectUser?._redirectEventId,i=r?._redirectEventId,s=await this.tryRedirectSignIn(e);(!t||t===i)&&s?.user&&(r=s.user,n=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(n)try{await this.beforeStateQueue.runMiddleware(r)}catch(e){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return(to(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId)?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await tj(e)}catch(e){if(e?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("u"<typeof navigator)return null;let e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}
7async updateCurrentUser(e){if(eP(this.app))return Promise.reject(ti(this));let t=e?W(e):null;return t&&to(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&to(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return eP(this.app)?Promise.reject(ti(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return eP(this.app)?Promise.reject(ti(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(tY(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=new rn(await rr(this));null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new N("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){let t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await tq(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){let r=await this.getOrInitRedirectPersistenceManager(t);return null===e?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&tY(e)||this._popupRedirectResolver;to(t,this,"argument-error"),this.redirectPersistenceManager=await tQ.create(this,[tY(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return(this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e)?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,n){if(this._deleted)return()=>{};let i="function"==typeof t?t:t.next.bind(t),s=!1,a=this._isInitialized?Promise.resolve():this._initializationPromise;if(to(a,this,"internal-error"),a.then(()=>{s||i(this.currentUser)}),"function"==typeof t){let i=e.addObserver(t,r,n);return()=>{s=!0,i()}}{let r=e.addObserver(t);return()=>{s=!0,r()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return to(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=re(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){let e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);let t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e["X-Firebase-Client"]=t);let r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(eP(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&function(e,...t){e7.logLevel<=l.WARN&&e7.warn(`Auth (${eM}): ${e}`,...t)}(`Error while retrieving App Check token: ${e.error}`),e?.token}}class rs{constructor(e){this.auth=e,this.observer=null,this.addObserver=H(e=>this.observer=e)}get next(){return to(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let ra={async loadJS(){throw Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function ro(e){return ra.loadJS(e)}function rl(e){return`__${e}${Math.floor(1e6*Math.random())}`}class rc{constructor(e){this.auth=e,this.counter=1e12,this._widgets=new Map}render(e,t){let r=this.counter;return this._widgets.set(r,new rd(e,this.auth.name,t||{})),this.counter++,r}reset(e){let t=e||1e12;this._widgets.get(t)?.delete(),this._widgets.delete(t)}getResponse(e){return this._widgets.get(e||1e12)?.getResponse()||""}async execute(e){return this._widgets.get(e||1e12)?.execute(),""}}class rh{constructor(){this.enterprise=new ru}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class ru{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class rd{constructor(e,t,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const n="string"==typeof e?document.getElementById(e):e;to(n,"argument-error",{appName:t}),this.container=n,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout(()=>{this.responseToken=function(){let e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<50;r++)e.push(t.charAt(Math.floor(Math.random()*t.length)));return e.join("")}();let{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()},6e4)},500))}checkIfDeleted(){if(this.deleted)throw Error("reCAPTCHA mock was already deleted!")}}let rp="NO_RECAPTCHA";class rf{constructor(e){this.type="recaptcha-enterprise",this.auth=function(e){return W(e)}(e)}async verify(e="verify",t=!1){async function r(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,r)=>
7{tC(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(n=>{if(void 0===n.recaptchaKey)r(Error("recaptcha Enterprise site key undefined"));else{let r=new tS(n);return null==e.tenantId?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,t(r.siteKey)}}).catch(e=>{r(e)})})}function n(t,r,n){let i=window.grecaptcha;tR(i)?i.enterprise.ready(()=>{i.enterprise.execute(t,{action:e}).then(e=>{r(e)}).catch(()=>{r(rp)})}):n(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new rh().execute("siteKey",{action:"verify"}):new Promise((e,i)=>{r(this.auth).then(r=>{if(!t&&tR(window.grecaptcha))n(r,e,i);else{if("u"<typeof window)return void i(Error("RecaptchaVerifier is only supported in browser"));let t=ra.recaptchaEnterpriseScript;0!==t.length&&(t+=r),ro(t).then(()=>{n(r,e,i)}).catch(e=>{i(e)})}}).catch(e=>{i(e)})})}}async function rm(e,t,r,n=!1,i=!1){let s,a=new rf(e);if(i)s=rp;else try{s=await a.verify(r)}catch(e){s=await a.verify(r,!0)}let o={...t};if("mfaSmsEnrollment"===r||"mfaSmsSignIn"===r){if("phoneEnrollmentInfo"in o){let e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){let e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return n?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function rg(e,t,r,n,i){if("EMAIL_PASSWORD_PROVIDER"===i)if(!e._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER"))return n(e,t).catch(async i=>{if("auth/missing-recaptcha-token"!==i.code)return Promise.reject(i);{console.log(`${r} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let i=await rm(e,t,r,"getOobCode"===r);return n(e,i)}});else{let i=await rm(e,t,r,"getOobCode"===r);return n(e,i)}if("PHONE_PROVIDER"!==i)return Promise.reject(i+" provider is not supported.");if(e._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){let i=await rm(e,t,r);return n(e,i).catch(async i=>{if(e._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")==="AUDIT"&&("auth/missing-recaptcha-token"===i.code||"auth/invalid-app-credential"===i.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${r} flow.`);let i=await rm(e,t,r,!1,!0);return n(e,i)}return Promise.reject(i)})}{let i=await rm(e,t,r,!1,!0);return n(e,i)}}async function r_(e){let t=W(e),r=new tS(await tC(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}));null==t.tenantId?t._agentRecaptchaConfig=r:t._tenantRecaptchaConfigs[t.tenantId]=r,r.isAnyProviderEnabled()&&new rf(t).verify()}function rv(e){let t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function ry(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}class rw{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return tl("not implemented")}_getIdTokenResponse(e){return tl("not implemented")}_linkToIdToken(e,t){return tl("not implemented")}_getReauthenticationResolver(e){return tl("not implemented")}}async function rI(e,t){return ty(e,"POST","/v1/accounts:resetPassword",tv(e,t))}async function rb(e,t){return ty(e,"POST","/v1/accounts:update",t)}async function rT(e,t){return ty(e,"POST","/v1/accounts:signUp",t)}async function rE(e,t){return ty(e,"POST","/v1/accounts:update",tv(e,t))}async function rk(e,t){return tI(e,"POST","/v1/accounts:signInWithPassword",tv(e,t))}async function rR(e,t){return ty(e,"POST","/v1/accounts:sendOobCode",tv(e,t))}async function rS(e,t){return rR(e,t)}async function rA(e,t){return rR(e,t)}async function rC(e,t){return rR(e,t)}async function rP(e,t){return rR(e,t)}async function rO(e,t){return tI(e,"POST","/v1/accounts:signInWithEmailLink",tv(e,t))}async function rN(e,t){return tI(e,"POST","/v1/accounts:signInWithEmailLink",tv(e,t))}class rD extends rw{constructor(e,t,r,n=null){super("password",r),this._email=e,this._password=t,this._tenantId=n}static _fromEmailAndPassword(e,t){return new rD(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new rD(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t="string"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);else if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return rg(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",rk,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return rO(e,{email:this._email,oobCode:this._password});default:tt(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return rg(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",rT,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return rN(e,{idToken:t,email:this._email,oobCode:this._password});default:tt(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function rL(e,t){return tI(e,"POST","/v1/accounts:signInWithIdp",tv(e,t))}class rU extends rw{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new rU(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&
7(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):tt("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let{providerId:t,signInMethod:r,...n}="string"==typeof e?JSON.parse(e):e;if(!t||!r)return null;let i=new rU(t,r);return i.idToken=n.idToken||void 0,i.accessToken=n.accessToken||void 0,i.secret=n.secret,i.nonce=n.nonce,i.pendingToken=n.pendingToken||null,i}_getIdTokenResponse(e){return rL(e,this.buildRequest())}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,rL(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,rL(e,t)}buildRequest(){let e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=x(t)}return e}}async function rM(e,t){return ty(e,"POST","/v1/accounts:sendVerificationCode",tv(e,t))}async function rx(e,t){return tI(e,"POST","/v1/accounts:signInWithPhoneNumber",tv(e,t))}async function rF(e,t){let r=await tI(e,"POST","/v1/accounts:signInWithPhoneNumber",tv(e,t));if(r.temporaryProof)throw tE(e,"account-exists-with-different-credential",r);return r}let rV={USER_NOT_FOUND:"user-not-found"};async function rH(e,t){return tI(e,"POST","/v1/accounts:signInWithPhoneNumber",tv(e,{...t,operation:"REAUTH"}),rV)}class rj extends rw{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new rj({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new rj({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return rx(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return rF(e,{idToken:t,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return rH(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:r,verificationCode:n}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:r,code:n}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));let{verificationId:t,verificationCode:r,phoneNumber:n,temporaryProof:i}=e;return r||t||n||i?new rj({verificationId:t,verificationCode:r,phoneNumber:n,temporaryProof:i}):null}}class rB{constructor(e){const t=F(V(e)),r=t.apiKey??null,n=t.oobCode??null,i=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(t.mode??null);to(r&&n&&i,"argument-error"),this.apiKey=r,this.operation=i,this.code=n,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){let t,r,n,i=(r=(t=F(V(e)).link)?F(V(t)).deep_link_id:null,((n=F(V(e)).deep_link_id)?F(V(n)).link:null)||n||r||t||e);try{return new rB(i)}catch{return null}}}class rW{constructor(){this.providerId=rW.PROVIDER_ID}static credential(e,t){return rD._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let r=rB.parseLink(t);return to(r,"argument-error"),rD._fromEmailAndCode(e,r.code,r.tenantId)}}rW.PROVIDER_ID="password",rW.EMAIL_PASSWORD_SIGN_IN_METHOD="password",rW.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class rz{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class rq extends rz{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class r$ extends rq{static credentialFromJSON(e){let t="string"==typeof e?JSON.parse(e):e;return to("providerId"in t&&"signInMethod"in t,"argument-error"),rU._fromParams(t)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return to(e.idToken||e.accessToken,"argument-error"),rU._fromParams({...e,providerId:this.providerId,sign
7InMethod:this.providerId})}static credentialFromResult(e){return r$.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return r$.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r,oauthTokenSecret:n,pendingToken:i,nonce:s,providerId:a}=e;if(!r&&!n&&!t&&!i||!a)return null;try{return new r$(a)._credential({idToken:t,accessToken:r,nonce:s,pendingToken:i})}catch(e){return null}}}class rG extends rq{constructor(){super("facebook.com")}static credential(e){return rU._fromParams({providerId:rG.PROVIDER_ID,signInMethod:rG.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return rG.credentialFromTaggedObject(e)}static credentialFromError(e){return rG.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return rG.credential(e.oauthAccessToken)}catch{return null}}}rG.FACEBOOK_SIGN_IN_METHOD="facebook.com",rG.PROVIDER_ID="facebook.com";class rK extends rq{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return rU._fromParams({providerId:rK.PROVIDER_ID,signInMethod:rK.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return rK.credentialFromTaggedObject(e)}static credentialFromError(e){return rK.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return rK.credential(t,r)}catch{return null}}}rK.GOOGLE_SIGN_IN_METHOD="google.com",rK.PROVIDER_ID="google.com";class rJ extends rq{constructor(){super("github.com")}static credential(e){return rU._fromParams({providerId:rJ.PROVIDER_ID,signInMethod:rJ.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return rJ.credentialFromTaggedObject(e)}static credentialFromError(e){return rJ.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return rJ.credential(e.oauthAccessToken)}catch{return null}}}rJ.GITHUB_SIGN_IN_METHOD="github.com",rJ.PROVIDER_ID="github.com";class rY extends rw{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return rL(e,this.buildRequest())}_linkToIdToken(e,t){let r=this.buildRequest();return r.idToken=t,rL(e,r)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,rL(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let{providerId:t,signInMethod:r,pendingToken:n}="string"==typeof e?JSON.parse(e):e;return t&&r&&n&&t===r?new rY(t,n):null}static _create(e,t){return new rY(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class rX extends rz{constructor(e){to(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return rX.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return rX.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let t=rY.fromJSON(e);return to(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:t,providerId:r}=e;if(!t||!r)return null;try{return rY._create(r,t)}catch(e){return null}}}class rZ extends rq{constructor(){super("twitter.com")}static credential(e,t){return rU._fromParams({providerId:rZ.PROVIDER_ID,signInMethod:rZ.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return rZ.credentialFromTaggedObject(e)}static credentialFromError(e){return rZ.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return rZ.credential(t,r)}catch{return null}}}async function rQ(e,t){return tI(e,"POST","/v1/accounts:signUp",tv(e,t))}rZ.TWITTER_SIGN_IN_METHOD="twitter.com",rZ.PROVIDER_ID="twitter.com";class r0{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,n=!1){return new r0({user:await tK._fromIdTokenResponse(e,r,n),providerId:r1(r),_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){return await e._updateTokensIfNecessary(r,!0),new r0({user:e,providerId:r1(r),_tokenResponse:r,operationType:t})}}function r1(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}async function r2(e){if(eP(e.app))return Promise.reject(ti(e));let t=W(e);
7if(await t._initializationPromise,t.currentUser?.isAnonymous)return new r0({user:t.currentUser,providerId:null,operationType:"signIn"});let r=await rQ(t,{returnSecureToken:!0}),n=await r0._fromIdTokenResponse(t,"signIn",r,!0);return await t._updateCurrentUser(n.user),n}class r6 extends O{constructor(e,t,r,n){super(t.code,t.message),this.operationType=r,this.user=n,Object.setPrototypeOf(this,r6.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,n){return new r6(e,t,r,n)}}function r3(e,t,r,n){return("reauthenticate"===t?r._getReauthenticationResolver(e):r._getIdTokenResponse(e)).catch(r=>{if("auth/multi-factor-auth-required"===r.code)throw r6._fromErrorAndOperation(e,r,t,n);throw r})}function r4(e){return new Set(e.map(({providerId:e})=>e).filter(e=>!!e))}async function r5(e,t){let r=W(e);await r9(!0,r,t);let{providerUserInfo:n}=await tO(r.auth,{idToken:await r.getIdToken(),deleteProvider:[t]}),i=r4(n||[]);return r.providerData=r.providerData.filter(e=>i.has(e.providerId)),i.has("phone")||(r.phoneNumber=null),await r.auth._persistUserIfCurrent(r),r}async function r8(e,t,r=!1){let n=await tF(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return r0._forOperation(e,"link",n)}async function r9(e,t,r){await tj(t),to(r4(t.providerData).has(r)===e,t.auth,!1===e?"provider-already-linked":"no-such-provider")}async function r7(e,t,r=!1){let{auth:n}=e;if(eP(n.app))return Promise.reject(ti(n));let i="reauthenticate";try{let s=await tF(e,r3(n,i,t,e),r);to(s.idToken,n,"internal-error");let a=tM(s.idToken);to(a,n,"internal-error");let{sub:o}=a;return to(e.uid===o,n,"user-mismatch"),r0._forOperation(e,i,s)}catch(e){throw e?.code==="auth/user-not-found"&&tt(n,"user-mismatch"),e}}async function ne(e,t,r=!1){if(eP(e.app))return Promise.reject(ti(e));let n="signIn",i=await r3(e,n,t),s=await r0._fromIdTokenResponse(e,n,i);return r||await e._updateCurrentUser(s.user),s}async function nt(e,t){return ne(W(e),t)}async function nr(e,t){let r=W(e);return await r9(!1,r,t.providerId),r8(r,t)}async function nn(e,t){return r7(W(e),t)}async function ni(e,t){return tI(e,"POST","/v1/accounts:signInWithCustomToken",tv(e,t))}async function ns(e,t){if(eP(e.app))return Promise.reject(ti(e));let r=W(e),n=await ni(r,{token:t,returnSecureToken:!0}),i=await r0._fromIdTokenResponse(r,"signIn",n);return await r._updateCurrentUser(i.user),i}class na{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?no._fromServerResponse(e,t):"totpInfo"in t?nl._fromServerResponse(e,t):tt(e,"internal-error")}}class no extends na{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new no(t)}}class nl extends na{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new nl(t)}}function nc(e,t,r){to(r.url?.length>0,e,"invalid-continue-uri"),to(void 0===r.dynamicLinkDomain||r.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),to(void 0===r.linkDomain||r.linkDomain.length>0,e,"invalid-hosting-link-domain"),t.continueUrl=r.url,t.dynamicLinkDomain=r.dynamicLinkDomain,t.linkDomain=r.linkDomain,t.canHandleCodeInApp=r.handleCodeInApp,r.iOS&&(to(r.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=r.iOS.bundleId),r.android&&(to(r.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=r.android.installApp,t.androidMinimumVersionCode=r.android.minimumVersion,t.androidPackageName=r.android.packageName)}async function nh(e){let t=W(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function nu(e,t,r){let n=W(e),i={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};r&&nc(n,i,r),await rg(n,i,"getOobCode",rA,"EMAIL_PASSWORD_PROVIDER")}async function nd(e,t,r){await rI(W(e),{oobCode:t,newPassword:r}).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&nh(e),t})}async function np(e,t){await rE(W(e),{oobCode:t})}async function nf(e,t){let r=W(e),n=await rI(r,{oobCode:t}),i=n.requestType;switch(to(i,r,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":to(n.newEmail,r,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":to(n.mfaInfo,r,"internal-error");default:to(n.email,r,"internal-error")}let s=null;return n.mfaInfo&&(s=na._fromServerResponse(W(r),n.mfaInfo)),{data:{email:("VERIFY_AND_CHANGE_EMAIL"===n.requestType?n.newEmail:n.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===n.requestType?n.email:n.newEmail)||null,multiFactorInfo:s},operation:i}}async function nm(e,t){let{data:r}=await nf(W(e),t);return r.email}async function ng(e,t,r){if(eP(e.app))return Promise.reject(ti(e));let n=W(e),i=rg(n,{returnSecureToken:!0,email:t,password:r,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",rQ,"EMAIL_PASSWORD_PROVIDER"),s=await i.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&nh(e),t}),a=await r0._fromIdTokenResponse(n,"signIn",s);return await n._updateCurrentUser(a.user),a}async function n_(e,t,r){let n=W(e),i={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};to(r.handleCodeInApp,n,"argument-error"),r&&nc(n,i,r),await rg(n,i,"getOobCode",rC,"EMAIL_PASSWORD_PROVIDER")}async function nv(e,t,r){if(eP(e.app))return Promise.reject(ti(e));let n=W(e),i=rW.credentialWithLink(t,r||tc());return to(i._tenantId===(n.tenantId||null),n,"tenant-id-mismatch"),nt(n,i)}async function ny(e,t){return ty(e,"POST","/v1/accounts:createAuthUri",tv(e,t))}async function nw(e,t){let r=th()?tc():"http://localhost",{signinMethods:n}=await ny(W(e),{identifier:t,continueUri:r});return n||[]}async function nI(e,t){let r=W(e),n={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&nc(r.auth,n,t);let{email:i}=await rS(r.auth,n);i!==e.email&&await e.reload()}async function nb(e,t,r){let n=W(e),i={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};r&&nc(n.auth,i,r);let{email:s}=await rP(n.auth,i);s!==e.email&&await e.reload()}async function nT(e,t){return ty(e,"POST","/v1/accounts:update",t)}async function nE(e,{displayName:t,photoURL:r}
7){if(void 0===t&&void 0===r)return;let n=W(e),i=await n.getIdToken(),s=await tF(n,nT(n.auth,{idToken:i,displayName:t,photoUrl:r,returnSecureToken:!0}));n.displayName=s.displayName||null,n.photoURL=s.photoUrl||null;let a=n.providerData.find(({providerId:e})=>"password"===e);a&&(a.displayName=n.displayName,a.photoURL=n.photoURL),await n._updateTokensIfNecessary(s)}async function nk(e,t,r){let{auth:n}=e,i={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(i.email=t),r&&(i.password=r);let s=await tF(e,rb(n,i));await e._updateTokensIfNecessary(s,!0)}class nR{constructor(e,t,r={}){this.isNewUser=e,this.providerId=t,this.profile=r}}class nS extends nR{constructor(e,t,r,n){super(e,t,r),this.username=n}}class nA extends nR{constructor(e,t){super(e,"facebook.com",t)}}class nC extends nS{constructor(e,t){super(e,"github.com",t,"string"==typeof t?.login?t?.login:null)}}class nP extends nR{constructor(e,t){super(e,"google.com",t)}}class nO extends nS{constructor(e,t,r){super(e,"twitter.com",t,r)}}class nN{constructor(e,t,r){this.type=e,this.credential=t,this.user=r}static _fromIdtoken(e,t){return new nN("enroll",e,t)}static _fromMfaPendingCredential(e){return new nN("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){if(e?.multiFactorSession){if(e.multiFactorSession?.pendingCredential)return nN._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);else if(e.multiFactorSession?.idToken)return nN._fromIdtoken(e.multiFactorSession.idToken)}return null}}class nD{constructor(e,t,r){this.session=e,this.hints=t,this.signInResolver=r}static _fromError(e,t){let r=W(e),n=t.customData._serverResponse,i=(n.mfaInfo||[]).map(e=>na._fromServerResponse(r,e));to(n.mfaPendingCredential,r,"internal-error");let s=nN._fromMfaPendingCredential(n.mfaPendingCredential);return new nD(s,i,async e=>{let i=await e._process(r,s);delete n.mfaInfo,delete n.mfaPendingCredential;let a={...n,idToken:i.idToken,refreshToken:i.refreshToken};switch(t.operationType){case"signIn":let o=await r0._fromIdTokenResponse(r,t.operationType,a);return await r._updateCurrentUser(o.user),o;case"reauthenticate":return to(t.user,r,"internal-error"),r0._forOperation(t.user,t.operationType,a);default:tt(r,"internal-error")}})}async resolveSignIn(e){return this.signInResolver(e)}}function nL(e,t){return ty(e,"POST","/v2/accounts/mfaEnrollment:start",tv(e,t))}class nU{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(t=>na._fromServerResponse(e.auth,t)))})}static _fromUser(e){return new nU(e)}async getSession(){return nN._fromIdtoken(await this.user.getIdToken(),this.user)}
7async enroll(e,t){let r=await this.getSession(),n=await tF(this.user,e._process(this.user.auth,r,t));return await this.user._updateTokensIfNecessary(n),this.user.reload()}async unenroll(e){let t="string"==typeof e?e:e.uid,r=await this.user.getIdToken();try{var n,i;let e=await tF(this.user,(n=this.user.auth,i={idToken:r,mfaEnrollmentId:t},ty(n,"POST","/v2/accounts/mfaEnrollment:withdraw",tv(n,i))));this.enrolledFactors=this.enrolledFactors.filter(({uid:e})=>e!==t),await this.user._updateTokensIfNecessary(e),await this.user.reload()}catch(e){throw e}}}let nM=new WeakMap,nx="__sak";class nF{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(nx,"1"),this.storage.removeItem(nx),Promise.resolve(!0)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class nV extends nF{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=t7(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let r=this.storage.getItem(t),n=this.localCache[t];r!==n&&e(t,n,r)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,r)=>{this.notifyListeners(e,r)});let r=e.key;t?this.detachListener():this.stopPolling();let n=()=>{let e=this.storage.getItem(r);(t||this.localCache[r]!==e)&&this.notifyListeners(r,e)},i=this.storage.getItem(r);C()&&10===document.documentMode&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(n,10):n()}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let e of Array.from(r))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}nV.type="LOCAL";class nH extends nF{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}nH.type="SESSION";class nj{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;let r=new nj(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let{eventId:t,eventType:r,data:n}=e.data,i=this.handlersMap[r];if(!i?.size)return;e.ports[0].postMessage({status:"ack",eventId:t,eventType:r});let s=Array.from(i).map(async t=>t(e.origin,n)),a=await Promise.all(s.map(async e=>{try{let t=await e;return{fulfilled:!0,value:t}}catch(e){return{fulfilled:!1,reason:e}}}));e.ports[0].postMessage({status:"done",eventId:t,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}
7function nB(e="",t=10){let r="";for(let e=0;e<t;e++)r+=Math.floor(10*Math.random());return e+r}nj.receivers=[];class nW{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){let n,i,s="u">typeof MessageChannel?new MessageChannel:null;if(!s)throw Error("connection_unavailable");return new Promise((a,o)=>{let l=nB("",20);s.port1.start();let c=setTimeout(()=>{o(Error("unsupported_event"))},r);i={messageChannel:s,onMessage(e){if(e.data.eventId===l)switch(e.data.status){case"ack":clearTimeout(c),n=setTimeout(()=>{o(Error("timeout"))},3e3);break;case"done":clearTimeout(n),a(e.data.response);break;default:clearTimeout(c),clearTimeout(n),o(Error("invalid_response"))}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}function nz(){return window}function nq(){return void 0!==nz().WorkerGlobalScope&&"function"==typeof nz().importScripts}async function n$(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}let nG="firebaseLocalStorageDb",nK="firebaseLocalStorage",nJ="fbase_key";class nY{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function nX(e,t){return e.transaction([nK],t?"readwrite":"readonly").objectStore(nK)}function nZ(){let e=indexedDB.open(nG,1);return new Promise((t,r)=>{e.addEventListener("error",()=>{r(e.error)}),e.addEventListener("upgradeneeded",()=>{let t=e.result;try{t.createObjectStore(nK,{keyPath:nJ})}catch(e){r(e)}}),e.addEventListener("success",async()=>{let r=e.result;r.objectStoreNames.contains(nK)?t(r):(r.close(),await new nY(indexedDB.deleteDatabase(nG)).toPromise(),t(await nZ()))})})}async function nQ(e,t,r){return new nY(nX(e,!0).put({[nJ]:t,value:r})).toPromise()}async function n0(e,t){let r=nX(e,!1).get(t),n=await new nY(r).toPromise();return void 0===n?null:n.value}function n1(e,t){return new nY(nX(e,!0).delete(t)).toPromise()}class n2{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await nZ()),this.db}async _withRetries(e){let t=0;for(;;)try{let t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return nq()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=nj._getInstance(nq()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await n$(),!this.activeServiceWorker)return;this.sender=new nW(this.activeServiceWorker);let e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;let e=await nZ();return await nQ(e,nx,"1"),await n1(e,nx),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>nQ(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>n0(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>n1(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>new nY(nX(e,!1).getAll()).toPromise());if(!e||0!==this.pendingWrites)return[];let t=[],r=new Set;if(0!==e.length)for(let{fbase_key:n,value:i}of e)r.add(n),JSON.stringify(this.localCache[n])!==JSON.stringify(i)&&(this.notifyListeners(n,i),t.push(n));for(let e of Object.keys(this.localCache))this.localCache[e]&&!r.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;let r=this.listeners[e];if(r)for(let e of Array.from(r))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}function n6(e,t){return ty(e,"POST","/v2/accounts/mfaSignIn:start",tv(e,t))}n2.type="LOCAL";let n3=rl("rcb"),n4=new td(3e4,6e4);class n5{constructor(){this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!nz().grecaptcha?.render}load(e,t=""){var r;return(to((r=t).length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(r),e,"argument-error"),this.shouldResolveImmediately(t)&&tk(nz().grecaptcha))?Promise.resolve(nz().grecaptcha):new Promise((r,n)=>{let i=nz().setTimeout(()=>{n(tr(e,"network-request-failed"))},n4.get());nz()[n3]=()=>{nz().clearTimeout(i),delete nz()[n3];let s=nz().grecaptcha;if(!s||!tk(s))return void n(tr(e,"internal-error"));let a=s.render;s.render=(e,t)=>{let r=a(e,t);return this.counter++,r},this.hostLanguage=t,r(s)},ro(`${ra.recaptchaV2Script}?${x({onload:n3,render:"explicit",hl:t})}`).catch(()=>{clearTimeout(i),n(tr(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!nz().grecaptcha?.render&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class n8{async load(e){return new rc(e)}clearedOneInstance(){}}let n9="recaptcha",n7={theme:"light",type:"image"};class ie{constructor(e,t,r={...n7}){this.parameters=r,this.type=n9,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=function(e){return W(e)}(e),this.isInvisible="invisible"===this.parameters.size,to("u">typeof document,this.auth,"operation-not-supported-in-this-environment");const n="string"==typeof t?document.getElementById(t):t;to(n,this.auth,"argument-error"),this.container=n,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new n8:new n5,this.validateStartingState()}async verify(){this.assertNotDestroyed();let e=await this.render(),t=this.getAssertedRecaptcha(),r=t.getResponse(e);return r||new Promise(r=>{let n=e=>{e&&(this.tokenChangeListeners.delete(n),r(e))};this.tokenChangeListeners.add(n),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e})),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEac
7h(e=>{this.container.removeChild(e)})}validateStartingState(){to(!this.parameters.sitekey,this.auth,"argument-error"),to(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),to("u">typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(e=>e(t)),"function"==typeof e)e(t);else if("string"==typeof e){let r=nz()[e];"function"==typeof r&&r(t)}}}assertNotDestroyed(){to(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){let e;to(th()&&!nq(),this.auth,"internal-error"),await (e=null,new Promise(t=>{"complete"===document.readyState?t():(e=()=>t(),window.addEventListener("load",e))}).catch(t=>{throw e&&window.removeEventListener("load",e),t})),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let t=await tA(this.auth);to(t,this.auth,"internal-error"),this.parameters.sitekey=t}getAssertedRecaptcha(){return to(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class it{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){let t=rj._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function ir(e,t,r){if(eP(e.app))return Promise.reject(ti(e));let n=W(e);return new it(await ia(n,t,W(r)),e=>nt(n,e))}async function ii(e,t,r){let n=W(e);return await r9(!1,n,"phone"),new it(await ia(n.auth,t,W(r)),e=>nr(n,e))}async function is(e,t,r){let n=W(e);return eP(n.auth.app)?Promise.reject(ti(n.auth)):new it(await ia(n.auth,t,W(r)),e=>nn(n,e))}async function ia(e,t,r){if(!e._getRecaptchaConfig())try{await r_(e)}catch(e){console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let n;if(n="string"==typeof t?{phoneNumber:t}:t,"session"in n){let t=n.session;if("phoneNumber"in n){to("enroll"===t.type,e,"internal-error");let i={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:n.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},s=async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===rp){to(r?.type===n9,e,"argument-error");let n=await il(e,t,r);return nL(e,n)}return nL(e,t)},a=rg(e,i,"mfaSmsEnrollment",s,"PHONE_PROVIDER");return(await a.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{to("signin"===t.type,e,"internal-error");let i=n.multiFactorHint?.uid||n.multiFactorUid;to(i,e,"missing-multi-factor-info");let s={mfaPendingCredential:t.credential,mfaEnrollmentId:i,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},a=async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===rp){to(r?.type===n9,e,"argument-error");let n=await il(e,t,r);return n6(e,n)}return n6(e,t)},o=rg(e,s,"mfaSmsSignIn",a,"PHONE_PROVIDER");return(await o.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{let t={phoneNumber:n.phoneNumber,clientType:"CLIENT_TYPE_WEB"},i=async(e,t)=>{if(t.captchaResponse===rp){to(r?.type===n9,e,"argument-error");let n=await il(e,t,r);return rM(e,n)}return rM(e,t)},s=rg(e,t,"sendVerificationCode",i,"PHONE_PROVIDER");return(await s.catch(e=>Promise.reject(e))).sessionInfo}}finally{r?._reset()}}async function io(e,t){let r=W(e);if(eP(r.auth.app))return Promise.reject(ti(r.auth));await r8(r,t)}async function il(e,t,r){to(r.type===n9,e,"argument-error");let n=await r.verify();to("string"==typeof n,e,"argument-error");let i={...t};if("phoneEnrollmentInfo"in i){let e=i.phoneEnrollmentInfo.phoneNumber,t=i.phoneEnrollmentInfo.captchaResponse,r=i.phoneEnrollmentInfo.clientType,s=i.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(i,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:n,captchaResponse:t,clientType:r,recaptchaVersion:s}}),i}if(!("phoneSignInInfo"in i))return Object.assign(i,{recaptchaToken:n}),i;{let e=i.phoneSignInInfo.captchaResponse,t=i.phoneSignInInfo.clientType,r=i.phoneSignInInfo.recaptchaVersion;return Object.assign(i,{phoneSignInInfo:{recaptchaToken:n,captchaResponse:e,clientType:t,recaptchaVersion:r}}),i}}class ic{constructor(e){this.providerId=ic.PROVIDER_ID,this.auth=function(e){return W(e)}(e)}verifyPhoneNumber(e,t){return ia(this.auth,e,W(t))}static credential(e,t){return rj._fromVerification(e,t)}static credentialFromResult(e){return ic.credentialFromTaggedObject(e)}static credentialFromError(e){return ic.credentialFromTaggedObject(e.customData||{})}
7static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:r}=e;return t&&r?rj._fromTokenResponse(t,r):null}}function ih(e,t){return t?tY(t):(to(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}ic.PROVIDER_ID="phone",ic.PHONE_SIGN_IN_METHOD="phone";class iu extends rw{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return rL(e,this._buildIdpRequest())}_linkToIdToken(e,t){return rL(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return rL(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function id(e){return ne(e.auth,new iu(e),e.bypassAuthState)}function ip(e){let{auth:t,user:r}=e;return to(r,t,"internal-error"),r7(r,new iu(e),e.bypassAuthState)}async function im(e){let{auth:t,user:r}=e;return to(r,t,"internal-error"),r8(r,new iu(e),e.bypassAuthState)}class ig{constructor(e,t,r,n,i=!1){this.auth=e,this.resolver=r,this.user=n,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:r,postBody:n,tenantId:i,error:s,type:a}=e;if(s)return void this.reject(s);let o={auth:this.auth,requestUri:t,sessionId:r,tenantId:i||void 0,postBody:n||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(o))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return id;case"linkViaPopup":case"linkViaRedirect":return im;case"reauthViaPopup":case"reauthViaRedirect":return ip;default:tt(this.auth,"internal-error")}}resolve(e){var t,r;t=this.pendingPromise,r="Pending promise was never set",t||tl(r),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){var t,r;t=this.pendingPromise,r="Pending promise was never set",t||tl(r),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}let i_=new td(2e3,1e4);async function iv(e,t,r){if(eP(e.app))return Promise.reject(tr(e,"operation-not-supported-in-this-environment"));let n=W(e);ts(e,t,rz);let i=ih(n,r);return new iI(n,"signInViaPopup",t,i).executeNotNull()}async function iy(e,t,r){let n=W(e);if(eP(n.auth.app))return Promise.reject(tr(n.auth,"operation-not-supported-in-this-environment"));ts(n.auth,t,rz);let i=ih(n.auth,r);return new iI(n.auth,"reauthViaPopup",t,i,n).executeNotNull()}async function iw(e,t,r){let n=W(e);ts(n.auth,t,rz);let i=ih(n.auth,r);return new iI(n.auth,"linkViaPopup",t,i,n).executeNotNull()}class iI extends ig{constructor(e,t,r,n,i){super(e,t,n,i),this.provider=r,this.authWindow=null,this.pollId=null,iI.currentPopupAction&&iI.currentPopupAction.cancel(),iI.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return to(e,this.auth,"internal-error"),e}async onExecution(){var e,t;e=1===this.filter.length,t="Popup operations only handle one event",e||tl(t);let r=nB();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],r),this.authWindow.associatedEvent=r,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(tr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(tr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,iI.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(tr(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,i_.get())};e()}}iI.currentPopupAction=null;let ib=new Map;class iT extends ig{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=ib.get(this.auth._key());if(!e){try{let t=await iE(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}ib.set(this.auth._key(),e)}return this.bypassAuthState||ib.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);
7if("unknown"===e.type)return void this.resolve(null);if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function iE(e,t){let r=iA(t),n=iS(e);if(!await n._isAvailable())return!1;let i=await n._get(r)==="true";return await n._remove(r),i}async function ik(e,t){return iS(e)._set(iA(t),"true")}function iR(e,t){ib.set(e._key(),t)}function iS(e){return tY(e._redirectPersistence)}function iA(e){return tZ("pendingRedirect",e.config.apiKey,e.name)}async function iC(e,t,r){if(eP(e.app))return Promise.reject(ti(e));let n=W(e);ts(e,t,rz),await n._initializationPromise;let i=ih(n,r);return await ik(i,n),i._openRedirect(n,t,"signInViaRedirect")}async function iP(e,t,r){let n=W(e);if(ts(n.auth,t,rz),eP(n.auth.app))return Promise.reject(ti(n.auth));await n.auth._initializationPromise;let i=ih(n.auth,r);await ik(i,n.auth);let s=await iL(n);return i._openRedirect(n.auth,t,"reauthViaRedirect",s)}async function iO(e,t,r){let n=W(e);ts(n.auth,t,rz),await n.auth._initializationPromise;let i=ih(n.auth,r);await r9(!1,n,t.providerId),await ik(i,n.auth);let s=await iL(n);return i._openRedirect(n.auth,t,"linkViaRedirect",s)}async function iN(e,t){return await W(e)._initializationPromise,iD(e,t,!1)}async function iD(e,t,r=!1){if(eP(e.app))return Promise.reject(ti(e));let n=W(e),i=ih(n,t),s=new iT(n,i,r),a=await s.execute();return a&&!r&&(delete a.user._redirectEventId,await n._persistUserIfCurrent(a.user),await n._setRedirectUser(null,t)),a}async function iL(e){let t=nB(`${e.uid}:::`);return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}class iU{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return ix(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!ix(e)){let r=e.error.code?.split("auth/")[1]||"internal-error";t.onError(tr(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let r=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(iM(e))}saveEventToCache(e){this.cachedEventUids.add(iM(e)),this.lastProcessedEventTime=Date.now()}}function iM(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function ix({type:e,error:t}){return"unknown"===e&&t?.code==="auth/no-auth-event"}async function iF(e,t={}){return ty(e,"GET","/v1/projects",t)}let iV=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,iH=/^https?/;async function ij(e){if(e.config.emulator)return;let{authorizedDomains:t}=await iF(e);for(let e of t)try{if(function(e){let t=tc(),{protocol:r,hostname:n}=new URL(t);if(e.startsWith("chrome-extension://")){let i=new URL(e);return""===i.hostname&&""===n?"chrome-extension:"===r&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===r&&i.hostname===n}if(!iH.test(r))return!1;if(iV.test(e))return n===e;let i=e.replace(/\./g,"\\.");return RegExp("^(.+\\."+i+"|"+i+")$","i").test(n)}(e))return}catch{}tt(e,"unauthorized-domain")}let iB=new td(3e4,6e4);function iW(){let e=nz().___jsl;if(e?.H){for(let t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}}let iz=null,iq=new td(5e3,15e3),i$={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"}
7,iG=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);async function iK(e){let t,r,n,i,s,a=await (iz=iz||new Promise((t,r)=>{function n(){iW(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{iW(),r(tr(e,"network-request-failed"))},timeout:iB.get()})}if(nz().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else if(nz().gapi?.load)n();else{let t=rl("iframefcb");return nz()[t]=()=>{gapi.load?n():r(tr(e,"network-request-failed"))},ro(`${ra.gapiScript}?onload=${t}`).catch(e=>r(e))}}).catch(e=>{throw iz=null,e})),o=nz().gapi;return to(o,e,"internal-error"),a.open({where:document.body,url:(to((t=e.config).authDomain,e,"auth-domain-config-required"),r=t.emulator?tp(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,n={apiKey:t.apiKey,appName:e.name,v:eM},(i=iG.get(e.config.apiHost))&&(n.eid=i),(s=e._getFrameworks()).length&&(n.fw=s.join(",")),`${r}?${x(n).slice(1)}`),messageHandlersFilter:o.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:i$,dontclear:!0},t=>new Promise(async(r,n)=>{await t.restyle({setHideOnLeave:!1});let i=tr(e,"network-request-failed"),s=nz().setTimeout(()=>{n(i)},iq.get());function a(){nz().clearTimeout(s),r(t)}t.ping(a).then(a,()=>{n(i)})}))}let iJ={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class iY{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}let iX=encodeURIComponent("fac");async function iZ(e,t,r,n,i,s){to(e.config.authDomain,e,"auth-domain-config-required"),to(e.config.apiKey,e,"invalid-api-key");let a={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:n,v:eM,eventId:i};if(t instanceof rz)for(let[r,n]of(t.setDefaultLanguage(e.languageCode),a.providerId=t.providerId||"",!function(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(t.getCustomParameters())&&(a.customParameters=JSON.stringify(t.getCustomParameters())),Object.entries(s||{})))a[r]=n;if(t instanceof rq){let e=t.getScopes().filter(e=>""!==e);e.length>0&&(a.scopes=e.join(","))}for(let t of(e.tenantId&&(a.tid=e.tenantId),Object.keys(a)))void 0===a[t]&&delete a[t];let o=await e._getAppCheckToken(),l=o?`#${iX}=${encodeURIComponent(o)}`:"";return`${function({config:e}){return e.emulator?tp(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${x(a).slice(1)}${l}`}let iQ="webStorageSupport",i0=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=nH,this._completeRedirectFn=iD,this._overrideRedirectResult=iR}async _openPopup(e,t,r,n){var i,s;i=this.eventManagers[e._key()]?.manager,s="_initialize() not called before _openPopup()",i||tl(s);let a=await iZ(e,t,r,tc(),n);return function(e,t,r,n=500,i=600){let s=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-n)/2,0).toString(),o="",l={...iJ,width:n.toString(),height:i.toString(),top:s,left:a},c=E().toLowerCase();r&&(o=t6(c)?"_blank":r),t1(c)&&(t=t||"http://localhost",l.scrollbars="yes");let h=Object.entries(l).reduce((e,[t,r])=>`${e}${t}=${r},`,"");if(function(e=E()){return t9(e)&&!!window.navigator?.standalone}(c)&&"_self"!==o){var u,d;let e,r;return u=t||"",d=o,(e=document.createElement("a")).href=u,e.target=d,(r=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),e.dispatchEvent(r),new iY(null)}let p=window.open(t||"",o,h);to(p,e,"popup-blocked");try{p.focus()}catch(e){}return new iY(p)}(e,a,nB())}async _openRedirect(e,t,r,n){var i;return await this._originValidation(e),i=await iZ(e,t,r,tc(),n),nz().location.href=i,new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){var r;let{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(r="If manager is not set, promise should be",n||tl(r),n)}let n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){let t=await iK(e),r=new iU(e);return t.register("authEvent",t=>
7(to(t?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(t.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(iQ,{type:iQ},r=>{let n=r?.[0]?.[iQ];void 0!==n&&t(!!n),tt(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=ij(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return t7()||t2()||t9()}};class i1{constructor(e){this.factorId=e}_process(e,t,r){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,r);case"signin":return this._finalizeSignIn(e,t.credential);default:return tl("unexpected MultiFactorSessionType")}}}class i2 extends i1{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new i2(e)}_finalizeEnroll(e,t,r){return ty(e,"POST","/v2/accounts/mfaEnrollment:finalize",tv(e,{idToken:t,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(e,t){return ty(e,"POST","/v2/accounts/mfaSignIn:finalize",tv(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}}class i6{static assertion(e){return i2._fromCredential(e)}}i6.FACTOR_ID="phone";var i3="@firebase/auth",i4="1.13.1";class i5{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return(this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser)?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){to(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}function i8(){return window}async function i9(e,t,r){var n,i;let{BuildInfo:s}=i8();n=t.sessionId,i="AuthEvent did not contain a session ID",n||tl(i);let a=await st(t.sessionId),o={};return t9()?o.ibi=s.packageName:t4()?o.apn=s.packageName:tt(e,"operation-not-supported-in-this-environment"),s.displayName&&(o.appDisplayName=s.displayName),o.sessionId=a,iZ(e,r,t.type,void 0,t.eventId??void 0,o)}async function i7(e){let{BuildInfo:t}=i8(),r={};t9()?r.iosBundleId=t.packageName:t4()?r.androidPackageName=t.packageName:tt(e,"operation-not-supported-in-this-environment"),await iF(e,r)}async function se(e,t,r){let{cordova:n}=i8(),i=()=>{};try{await new Promise((s,a)=>{let o=null;function l(){s();let e=n.plugins.browsertab?.close;"function"==typeof e&&e(),"function"==typeof r?.close&&r.close()}function c(){o||(o=window.setTimeout(()=>{a(tr(e,"redirect-cancelled-by-user"))},2e3))}function h(){document?.visibilityState==="visible"&&c()}t.addPassiveListener(l),document.addEventListener("resume",c,!1),t4()&&document.addEventListener("visibilitychange",h,!1),i=()=>{t.removePassiveListener(l),document.removeEventListener("resume",c,!1),document.removeEventListener("visibilitychange",h,!1),o&&window.clearTimeout(o)}})}finally{i()}}async function st(e){let t=function(e){var t,r;if(t=/[0-9a-zA-Z]+/.test(e),r="Can only convert alpha-numeric strings",t||tl(r),"u">typeof TextEncoder)return new TextEncoder().encode(e);let n=new Uint8Array(new ArrayBuffer(e.length));for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>e.toString(16).padStart(2,"0")).join("")}I()?._authIdTokenMaxAge,ra={loadJS:e=>new Promise((t,r)=>{let n=document.createElement("script");n.setAttribute("src",e),n.onload=t,n.onerror=e=>{let t=tr("internal-error");t.customData=e,r(t)},n.type="text/javascript",n.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).appendChild(n)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},s="Browser",ek(new $("auth",(e,{options:t})=>{let r,n,i=e.getProvider("app").getImmediate(),a=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:l,authDomain:c}=i.options;to(l&&!l.includes(":"),"invalid-api-key",{appName:i.name});let h=new ri(i,a,o,{apiKey:l,authDomain:c,clientPlatform:s,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:re(s)});return n=(Array.isArray(r=t?.persistence||[])?r:[r]).map(tY),t?.errorMap&&h._updateErrorMap(t.errorMap),h._initializeWithPersistence(n,t?.popupRedirectResolver),h},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),ek(new $("auth-internal",e=>new i5(W(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),eB(i3,i4,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(s)),eB(i3,i4,"esm2020");class sr extends iU{constructor(){super(...arguments),this.passiveListeners=new Set,this.initPromise=new Promise(e=>{this.resolveInitialized=e})}addPassiveListener(e){this.passiveListeners.add(e)}removePassiveListener(e){this.passiveListeners.delete(e)}resetRedirect(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1}onEvent(e){return this.resolveInitialized(),this.passiveListeners.forEac
7h(t=>t(e)),super.onEvent(e)}async initialized(){await this.initPromise}}async function sn(e){let t=await tY(nV)._get(si(e));return t&&await tY(nV)._remove(si(e)),t}function si(e){return tZ("authEvent",e.config.apiKey,e.name)}function ss(e){if(!e?.includes("?"))return{};let[t,...r]=e.split("?");return F(r.join("?"))}let sa=class{constructor(){this._redirectPersistence=nH,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=iD,this._overrideRedirectResult=iR}async _initialize(e){let t=e._key(),r=this.eventManagers.get(t);return r||(r=new sr(e),this.eventManagers.set(t,r),this.attachCallbackListeners(e,r)),r}_openPopup(e){tt(e,"operation-not-supported-in-this-environment")}async _openRedirect(e,t,r,n){let i;i=i8(),to("function"==typeof i?.universalLinks?.subscribe,e,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),to(void 0!==i?.BuildInfo?.packageName,e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),to("function"==typeof i?.cordova?.plugins?.browsertab?.openUrl,e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),to("function"==typeof i?.cordova?.plugins?.browsertab?.isAvailable,e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),to("function"==typeof i?.cordova?.InAppBrowser?.open,e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"});let s=await this._initialize(e);await s.initialized(),s.resetRedirect(),ib.clear(),await this._originValidation(e);let a=function(e,t,r=null){return{type:t,eventId:r,urlResponse:null,sessionId:function(){let e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<20;r++){let r=Math.floor(Math.random()*t.length);e.push(t.charAt(r))}return e.join("")}(),postBody:null,tenantId:e.tenantId,error:tr(e,"no-auth-event")}}(e,r,n);await tY(nV)._set(si(e),a);let o=await i9(e,a,t);return se(e,s,await function(e){let{cordova:t}=i8();return new Promise(r=>{t.plugins.browsertab.isAvailable(n=>{let i=null;n?t.plugins.browsertab.openUrl(e):i=t.InAppBrowser.open(e,!function(e=E()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(e)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(e)}()?"_system":"_blank","location=yes"),r(i)})})}(o))}_isIframeWebStorageSupported(e,t){throw Error("Method not implemented.")}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=i7(e)),this.originValidationPromises[t]}attachCallbackListeners(e,t){let{universalLinks:r,handleOpenURL:n,BuildInfo:i}=i8(),s=setTimeout(async()=>{await sn(e),t.onEvent(so())},500),a=async r=>{clearTimeout(s);let n=await sn(e),i=null;n&&r?.url&&(i=function(e,t){var r;let n,i,s,a,o=(i=(n=ss(r=t)).link?decodeURIComponent(n.link):void 0,s=ss(i).link,ss(a=n.deep_link_id?decodeURIComponent(n.deep_link_id):void 0).link||a||s||i||r);if(o.includes("/__/auth/callback")){let t=ss(o),r=t.firebaseError?function(e){try{return JSON.parse(e)}catch(e){return null}}(decodeURIComponent(t.firebaseError)):null,n=r?.code?.split("auth/")?.[1],i=n?tr(n):null;return i?{type:e.type,eventId:e.eventId,tenantId:e.tenantId,error:i,urlResponse:null,sessionId:null,postBody:null}:{type:e.type,eventId:e.eventId,tenantId:e.tenantId,sessionId:e.sessionId,urlResponse:o,postBody:null}}return null}(n,r.url)),t.onEvent(i||so())};void 0!==r&&"function"==typeof r.subscribe&&r.subscribe(null,a);let o=`${i.packageName.toLowerCase()}://`;i8().handleOpenURL=async e=>{if(e.toLowerCase().startsWith(o)&&a({url:e}),"function"==typeof n)try{n(e)}catch(e){console.error(e)}}}};function so(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:tr("no-auth-event")}}function sl(){return self?.location?.protocol||null}function sc(e=E()){return!!(("file:"===sl()||"ionic:"===sl()||"capacitor:"===sl())&&e.toLowerCase().match(/iphone|ipad|ipod|android/))}function sh(){try{let e=self.localStorage,t=nB();if(e){if(e.setItem(t,"1"),e.removeItem(t),function(e=E()){return C()&&document?.documentMode===11||function(e=E()){return/Edge\/\d+/.test(e)}(e)}())return P();return!0}}catch(e){return su()&&P()}return!1}function su(){return"WorkerGlobalScope"in e.g&&"importScripts"in e.g}function sd(){return("http:"===sl()||"https:"===sl()||S()||sc())&&!(A()||k())&&sh()&&!su()}function sp(){return sc()&&"u">typeof document}async function sf(){return!!sp()&&new Promise(e=>{let t=setTimeout(()=>{e(!1)},1e3);document.addEventListener("deviceready",()=>{clearTimeout(t),e(!0)})})}let sm={LOCAL:"local",NONE:"none",SESSION:"session"},sg="persistence";async function s_(e){await e._initializationPromise;let t=sv(),r=tZ(sg,e.config.apiKey,e.name);t&&t.setItem(r,e._getPersistenceType())}function sv(){try{return("u">typeof window?window:null)?.sessionStorage||null}catch(e){return null}}class sy{constructor(){this.browserResolver=tY(i0),this.cordovaResolver=tY(sa),this.underlyingResolver=null,this._redirectPersistence=nH,this._completeRedirectFn=iD,this._overrideRedirectResult=iR}async _initialize(e){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._initialize(e)}async _openPopup(e,t,r,n){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openPopup(e,t,r,n)}async _openRedirect(e,t,r,n){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openRedirect(e,t,r,n)}_isIframeWebStorageSupported(e,t){this.assertedUnderlyingResolver._isIframeWebStorageSupported(e,t)}_originValidation(e){return this.assertedUnderlyingResolver._originValidation(e)}get _shouldInitProactively(){return sp()||this.browserResolver._shouldInitProactively}get assertedUnderlyingResolver(){return to(this.underlyingResolver,"internal-error"),this.underlyingResolver}async selectUnderlyingResolver(){if(this.underlyingResolver)return;let e=await sf();this.underlyingResolver=e?this.cordovaResolver:this.browserResolver}}function sw(e){let t,{_tokenResponse:r}=e instanceof O?e.customData:e;if(!r)return null;if(!(e instanceof O)&&"temporaryProof"in r&&"phoneNumber"in r)return ic.credentialFromResult(e);let n=r.providerId;if(!n||"password"===n)return null;switch(n){case"google.com":t=rK;break;case"facebook.com":t=rG;break;case"github.com":t=rJ;break;case"twitter.com":t=rZ;break;default:let{oauthIdToken:i,oauthAccessToken:s,oauthTokenSecret:a,pe
7ndingToken:o,nonce:l}=r;if(!s&&!a&&!i&&!o)return null;if(o)if(n.startsWith("saml."))return rY._create(n,o);else return rU._fromParams({providerId:n,signInMethod:n,pendingToken:o,idToken:i,accessToken:s});return new r$(n).credential({idToken:i,accessToken:s,rawNonce:l})}return e instanceof O?t.credentialFromError(e):t.credentialFromResult(e)}function sI(e,t){return t.catch(t=>{throw t instanceof O&&function(e,t){let r=t.customData?._tokenResponse;if(t?.code==="auth/multi-factor-auth-required"){let r;t.resolver=new sT(e,(r=W(e),to(t.customData.operationType,r,"argument-error"),to(t.customData._serverResponse?.mfaPendingCredential,r,"argument-error"),nD._fromError(r,t)))}else if(r){let e=sw(t);e&&(t.credential=e,t.tenantId=r.tenantId||void 0,t.email=r.email||void 0,t.phoneNumber=r.phoneNumber||void 0)}}(e,t),t}).then(e=>{let t=e.operationType,r=e.user;return{operationType:t,credential:sw(e),additionalUserInfo:function(e){let{user:t,_tokenResponse:r}=e;return t.isAnonymous&&!r?{providerId:null,isNewUser:!1,profile:null}:function(e){if(!e)return null;let{providerId:t}=e,r=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},n=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!t&&e?.idToken){let t=tM(e.idToken)?.firebase?.sign_in_provider;if(t)return new nR(n,"anonymous"!==t&&"custom"!==t?t:null)}if(!t)return null;switch(t){case"facebook.com":return new nA(n,r);case"github.com":return new nC(n,r);case"google.com":return new nP(n,r);case"twitter.com":return new nO(n,r,e.screenName||null);case"custom":case"anonymous":return new nR(n,null);default:return new nR(n,t,r)}}(r)}(e),user:sE.getOrCreate(r)}})}async function sb(e,t){let r=await t;return{verificationId:r.verificationId,confirm:t=>sI(e,r.confirm(t))}}class sT{constructor(e,t){this.resolver=t,this.auth=function(e){return e.wrapped()}(e)}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(e){return sI(this.auth.unwrap(),this.resolver.resolveSignIn(e))}}class sE{constructor(e){this._delegate=e,this.multiFactor=function(e){let t=W(e);return nM.has(t)||nM.set(t,nU._fromUser(t)),nM.get(t)}(e)}static getOrCreate(e){return sE.USER_MAP.has(e)||sE.USER_MAP.set(e,new sE(e)),sE.USER_MAP.get(e)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(e){return this._delegate.getIdTokenResult(e)}getIdToken(e){return this._delegate.getIdToken(e)}linkAndRetrieveDataWithCredential(e){return this.linkWithCredential(e)}async linkWithCredential(e){return sI(this.auth,nr(this._delegate,e))}async linkWithPhoneNumber(e,t){return sb(this.auth,ii(this._delegate,e,t))}async linkWithPopup(e){return sI(this.auth,iw(this._delegate,e,sy))}async linkWithRedirect(e){return await s_(W(this.auth)),iO(this._delegate,e,sy)}reauthenticateAndRetrieveDataWithCredential(e){return this.reauthenticateWithCredential(e)}async reauthenticateWithCredential(e){return sI(this.auth,nn(this._delegate,e))}reauthenticateWithPhoneNumber(e,t){return sb(this.auth,is(this._delegate,e,t))}reauthenticateWithPopup(e){return sI(this.auth,iy(this._delegate,e,sy))}async reauthenticateWithRedirect(e){return await s_(W(this.auth)),iP(this._delegate,e,sy)}sendEmailVerification(e){return nI(this._delegate,e)}async unlink(e){return await r5(this._delegate,e),this}updateEmail(e){var t;let r;return t=this._delegate,eP((r=W(t)).auth.app)?Promise.reject(ti(r.auth)):nk(r,e,null)}updatePassword(e){var t;return t=this._delegate,nk(W(t),null,e)}updatePhoneNumber(e){return io(this._delegate,e)}updateProfile(e){return nE(this._delegate,e)}verifyBeforeUpdateEmail(e,t){return nb(this._delegate,e,t)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}}sE.USER_MAP=new WeakMap;class sk{constructor(e,t){if(this.app=e,t.isInitialized()){this._delegate=t.getImmediate(),this.linkUnderlyingAuth();return}const{apiKey:r}=e.options;
7to(r,"invalid-api-key",{appName:e.name}),to(r,"invalid-api-key",{appName:e.name});const n="u">typeof window?sy:void 0;this._delegate=t.initialize({options:{persistence:function(e,t){let r=function(e,t){let r=sv();if(!r)return[];let n=tZ(sg,e,t);switch(r.getItem(n)){case sm.NONE:return[tX];case sm.LOCAL:return[n2,nH];case sm.SESSION:return[nH];default:return[]}}(e,t);if("u">typeof self&&!r.includes(n2)&&r.push(n2),"u">typeof window)for(let e of[nV,nH])r.includes(e)||r.push(e);return r.includes(tX)||r.push(tX),r}(r,e.name),popupRedirectResolver:n}}),this._delegate._updateErrorMap(e8),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?sE.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(e){this._delegate.languageCode=e}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(e){this._delegate.tenantId=e}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(e,t){!function(e,t,r){let n=W(e);to(/^https?:\/\//.test(t),n,"invalid-emulator-scheme");let i=!!r?.disableWarnings,s=rv(t),{host:a,port:o}=function(e){let t=rv(e),r=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!r)return{host:"",port:null};let n=r[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(n);if(i){let e=i[1];return{host:e,port:ry(n.substr(e.length+1))}}{let[e,t]=n.split(":");return{host:e,port:ry(t)}}}(t),l=null===o?"":`:${o}`,c={url:`${s}//${a}${l}/`},h=Object.freeze({host:a,port:o,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!n._canInitEmulator){to(n.config.emulator&&n.emulatorConfig,n,"emulator-config-failed"),to(U(c,n.config.emulator)&&U(h,n.emulatorConfig),n,"emulator-config-failed");return}n.config.emulator=c,n.emulatorConfig=h,n.settings.appVerificationDisabledForTesting=!0,z(a)?q(`${s}//${a}${l}`):i||function(){function e(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"u">typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),"u">typeof window&&"u">typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}(this._delegate,e,t)}applyActionCode(e){return np(this._delegate,e)}checkActionCode(e){return nf(this._delegate,e)}confirmPasswordReset(e,t){return nd(this._delegate,e,t)}async createUserWithEmailAndPassword(e,t){return sI(this._delegate,ng(this._delegate,e,t))}fetchProvidersForEmail(e){return this.fetchSignInMethodsForEmail(e)}fetchSignInMethodsForEmail(e){return nw(this._delegate,e)}isSignInWithEmailLink(e){let t;return this._delegate,t=rB.parseLink(e),t?.operation==="EMAIL_SIGNIN"}async getRedirectResult(){to(sd(),this._delegate,"operation-not-supported-in-this-environment");let e=await iN(this._delegate,sy);return e?sI(this._delegate,Promise.resolve(e)):{credential:null,user:null}}addFrameworkForLogging(e){W(this._delegate)._logFramework(e)}onAuthStateChanged(e,t,r){let{next:n,error:i,complete:s}=sR(e,t,r);return this._delegate.onAuthStateChanged(n,i,s)}onIdTokenChanged(e,t,r){let{next:n,error:i,complete:s}=sR(e,t,r);return this._delegate.onIdTokenChanged(n,i,s)}sendSignInLinkToEmail(e,t){return n_(this._delegate,e,t)}sendPasswordResetEmail(e,t){return nu(this._delegate,e,t||void 0)}async setPersistence(e){var t;let r;switch(t=this._delegate,(to(Object.values(sm).includes(e),t,"invalid-persistence-type"),A())?to(e!==sm.SESSION,t,"unsupported-persistence-type"):k()?to(e===sm.NONE,t,"unsupported-persistence-type"):su()?to(e===sm.NONE||e===sm.LOCAL&&P(),t,"unsupported-persistence-type"):to(e===sm.NONE||sh(),t,"unsupported-persistence-type"),e){case sm.SESSION:r=nH;break;case sm.LOCAL:r=await tY(n2)._isAvailable()?n2:nV;break;case sm.NONE:r=tX;break;default:return tt("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(r)}signInAndRetrieveDataWithCredential(e){return this.signInWithCredential(e)}signInAnonymously(){return sI(this._delegate,r2(this._delegate))}signInWithCredential(e){return sI(this._delegate,nt(this._delegate,e))}signInWithCustomToken(e){return sI(this._delegate,ns(this._delegate,e))}signInWithEmailAndPassword(e,t){var r;return sI(this._delegate,(r=this._delegate,eP(r.app)?Promise.reject(ti(r)):nt(W(r),rW.credential(e,t)).catch(async e=>{throw"auth/password-does-not-meet-requirements"===e.code&&nh(r),e})))}signInWithEmailLink(e,t){return sI(this._delegate,nv(this._delegate,e,t))}signInWithPhoneNumber(e,t){return sb(this._delegate,ir(this._delegate,e,t))}async signInWithPopup(e){return to(sd(),this._delegate,"operation-not-supported-in-this-environment"),sI(this._delegate,iv(this._delegate,e,sy))}async signInWithRedirect(e){return to(sd(),this._delegate,"operation-not-supported-in-this-environment"),await s_(this._delegate),iC(this._delegate,e,sy)}updateCurrentUser(e){return this._delegate.updateCurrentUser(e)}verifyPasswordResetCode(e){return nm(this._delegate,e)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}function sR(e,t,r){let n=e;"function"!=typeof e&&({next:n,error:t,complete:r}=e);let i=n;return{next:e=>i(e&&sE.getOrCreate(e)),error:t,complete:r}}sk.Persistence=sm;class sS{static credential(e,t){return ic.credential(e,t)}constructor(){this.providerId="phone",this._delegate=new ic(function(e){return e.unwrap()}(e3.auth()))}verifyPhoneNumber(e,t){return this._delegate.verifyPhoneNumber(e,t)}unwrap(){return this._delegate}}sS.PHONE_SIGN_IN_METHOD=ic.PHONE_SIGN_IN_METHOD,sS.PROVIDER_ID=ic.PROVIDER_ID;e3.INTERNAL.registerComponent(new $("auth-compat",e=>new sk(e.getProvider("app-compat").getImmediate(),e.getProvider("auth")),"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"}},EmailAuthProvider:rW,FacebookAuthProvider:rG,GithubAuthProvider:rJ,GoogleAuthProvider:rK,OAuthProvider:r$,SAMLAuthProvider:rX,PhoneAuthProvider:sS,PhoneMultiFactorGenerator:i6,RecaptchaVerifier:class e{constructor(e,t,r=e3.app()){to(r.options?.apiKey,"invalid-api-key",{appName:r.name}),this._delegate=new ie(r.auth(),e,t),this.type=this._delegate.type}clear(){this._delegate.clear()}render(){return this._delegate.render()}verify(){return this._delegate.verify()}},TwitterAuthProvider:rZ,Auth:sk,AuthCredential:rw,Error:O}).setInstantiationMode("LAZY").setMultipleInstances(!1)),e3.registerVersion("@firebase/auth-compat","0.6.6"),e.s([],83439);let sA="firebasestorage.googleapis.com",sC="storageBucket";class sP extends O{constructor(e,t,r=0){super(sO(e),`Firebase Storage: ${t} (${sO(e)}
7)`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,sP.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return sO(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage} 8${this.customData.serverResponse}`:this.message=this._baseMessage}}function sO(e){return"storage/"+e}function sN(){return new sP(c.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function sD(){return new sP(c.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function sL(){return new sP(c.CANCELED,"User canceled the upload/download.")}function sU(){return new sP(c.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function sM(e){return new sP(c.INVALID_ARGUMENT,e)}function sx(){return new sP(c.APP_DELETED,"The Firebase app was deleted.")}function sF(e){return new sP(c.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 sV(e,t){return new sP(c.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function sH(e){throw new sP(c.INTERNAL_ERROR,"Internal error: "+e)}(a=c||(c={})).UNKNOWN="unknown",a.OBJECT_NOT_FOUND="object-not-found",a.BUCKET_NOT_FOUND="bucket-not-found",a.PROJECT_NOT_FOUND="project-not-found",a.QUOTA_EXCEEDED="quota-exceeded",a.UNAUTHENTICATED="unauthenticated",a.UNAUTHORIZED="unauthorized",a.UNAUTHORIZED_APP="unauthorized-app",a.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",a.INVALID_CHECKSUM="invalid-checksum",a.CANCELED="canceled",a.INVALID_EVENT_NAME="invalid-event-name",a.INVALID_URL="invalid-url",a.INVALID_DEFAULT_BUCKET="invalid-default-bucket",a.NO_DEFAULT_BUCKET="no-default-bucket",a.CANNOT_SLICE_BLOB="cannot-slice-blob",a.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",a.NO_DOWNLOAD_URL="no-download-url",a.INVALID_ARGUMENT="invalid-argument",a.INVALID_ARGUMENT_COUNT="invalid-argument-count",a.APP_DELETED="app-deleted",a.INVALID_ROOT_OPERATION="invalid-root-operation",a.INVALID_FORMAT="invalid-format",a.INTERNAL_ERROR="internal-error",a.UNSUPPORTED_ENVIRONMENT="unsupported-environment";class sj{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){let e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let r;try{r=sj.makeFromUrl(e,t)}catch(t){return new sj(e,"")}if(""===r.path)return r;throw new sP(c.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}static makeFromUrl(e,t){let r=null,n="([A-Za-z0-9.\\-_]+)",i=RegExp("^gs://"+n+"(/(.*))?$","i");function s(e){e.path_=decodeURIComponent(e.path)}let a=t.replace(/[.]/g,"\\."),o=RegExp(`^https?://${a}/v[A-Za-z0-9_]+/b/${n}/o(/([^?#]*).*)?$`,"i"),l=t===sA?"(?:storage.googleapis.com|storage.cloud.google.com)":t,h=[{regex:i,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:o,indices:{bucket:1,path:3},postModify:s},{regex:RegExp(`^https?://${l}/${n}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:s}];for(let t=0;t<h.length;t++){let n=h[t],i=n.regex.exec(e);if(i){let e=i[n.indices.bucket],t=i[n.indices.path];t||(t=""),r=new sj(e,t),n.postModify(r);break}}if(null==r)throw new sP(c.INVALID_URL,"Invalid URL '"+e+"'.");return r}}class sB{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function sW(e){return"string"==typeof e||e instanceof String}function sz(e){return sq()&&e instanceof Blob}function sq(){return"u">typeof Blob}function s$(e,t,r,n){if(n<t)throw sM(`Invalid value for '${e}'. Expected ${t} or greater.`);if(n>r)throw sM(`Invalid value for '${e}'. Expected ${r} or less.`)}function sG(e,t,r){let n=t;return null==r&&(n=`https://${t}`),`${r}://${n}/v0${e}`}function sK(e){let t=encodeURIComponent,r="?";for(let n in e)e.hasOwnProperty(n)&&(r=r+(t(n)+"=")+t(e[n])+"&");return r.slice(0,-1)}function sJ(e,t){let r=e>=500&&e<600,n=-1!==[408,429].indexOf(e),i=-1!==t.indexOf(e);return r||n||i}(o=h||(h={}
8))[o.NO_ERROR=0]="NO_ERROR",o[o.NETWORK_ERROR=1]="NETWORK_ERROR",o[o.ABORT=2]="ABORT";class sY{constructor(e,t,r,n,i,s,a,o,l,c,h,u=!0,d=!1){this.url_=e,this.method_=t,this.headers_=r,this.body_=n,this.successCodes_=i,this.additionalRetryCodes_=s,this.callback_=a,this.errorCallback_=o,this.timeout_=l,this.progressCallback_=c,this.connectionFactory_=h,this.retry=u,this.isUsingEmulator=d,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_(){let e=(e,t)=>{if(t)return void e(!1,new sX(!1,null,!0));let r=this.connectionFactory_();this.pendingConnection_=r;let n=e=>{let t=e.loaded,r=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,r)};null!==this.progressCallback_&&r.addUploadProgressListener(n),r.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&r.removeUploadProgressListener(n),this.pendingConnection_=null;let t=r.getErrorCode()===h.NO_ERROR,i=r.getStatus();!t||sJ(i,this.additionalRetryCodes_)&&this.retry?e(!1,new sX(!1,null,r.getErrorCode()===h.ABORT)):e(!0,new sX(-1!==this.successCodes_.indexOf(i),r))})},t=(e,t)=>{let r=this.resolve_,n=this.reject_,i=t.connection;if(t.wasSuccessCode)try{let e=this.callback_(i,i.getResponse());void 0!==e?r(e):r()}catch(e){n(e)}else if(null!==i){let e=sN();e.serverResponse=i.getErrorText(),n(this.errorCallback_?this.errorCallback_(i,e):e)}else n(t.canceled?this.appDelete_?sx():sL():sD())};this.canceled_?t(!1,new sX(!1,null,!0)):this.backoffId_=function(e,t,r){let n=1,i=null,s=null,a=!1,o=0,l=!1;function c(...e){l||(l=!0,t.apply(null,e))}function h(t){i=setTimeout(()=>{i=null,e(d,2===o)},t)}function u(){s&&clearTimeout(s)}function d(e,...t){let r;if(l)return void u();if(e||2===o||a){u(),c.call(null,e,...t);return}n<64&&(n*=2),1===o?(o=2,r=0):r=(n+Math.random())*1e3,h(r)}let p=!1;function f(e){p||(p=!0,u(),!l&&(null!==i?(e||(o=2),clearTimeout(i),h(0)):e||(o=1)))}return h(0),s=setTimeout(()=>{a=!0,f(!0)},r),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()}}class sX{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}function sZ(...e){let t="u">typeof BlobBuilder?BlobBuilder:"u">typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0;if(void 0!==t){let r=new t;for(let t=0;t<e.length;t++)r.append(e[t]);return r.getBlob()}if(sq())return new Blob(e);throw new sP(c.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}let sQ={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class s0{constructor(e,t){this.data=e,this.contentType=t||null}}function s1(e,t){switch(e){case sQ.RAW:return new s0(s2(t));case sQ.BASE64:case sQ.BASE64URL:return new s0(s6(e,t));case sQ.DATA_URL:return new s0(function(e){let t,r=new s3(e);if(r.base64)return s6(sQ.BASE64,r.rest);var n=r.rest;try{t=decodeURIComponent(n)}catch(e){throw sV(sQ.DATA_URL,"Malformed data URL.")}return s2(t)}(t),new s3(t).contentType)}throw sN()}function s2(e){let t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<=127?t.push(n):n<=2047?t.push(192|n>>6,128|63&n):(64512&n)==55296?r<e.length-1&&(64512&e.charCodeAt(r+1))==56320?(n=65536|(1023&n)<<10|1023&e.charCodeAt(++r),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)):t.push(239,191,189):(64512&n)==56320?t.push(239,191,189):t.push(224|n>>12,128|n>>6&63,128|63&n)}return new Uint8Array(t)}function s6(e,t){let r;switch(e){case sQ.BASE64:{let r=-1!==t.indexOf("-"),n=-1!==t.indexOf("_");if(r||n)throw sV(e,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case sQ.BASE64URL:{let r=-1!==t.indexOf("+"),n=-1!==t.indexOf("/");if(r||n)throw sV(e,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/")}}try{r=function(e){if("u"<typeof atob)throw new sP(c.UNSUPPORTED_ENVIRONMENT,"base-64 is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.");return atob(e)}(t)}
8catch(t){if(t.message.includes("polyfill"))throw t;throw sV(e,"Invalid character found")}let n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}class s3{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(null===t)throw sV(sQ.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const r=t[1]||null;null!=r&&(this.base64=function(e,t){return e.length>=t.length&&e.substring(e.length-t.length)===t}(r,";base64"),this.contentType=this.base64?r.substring(0,r.length-7):r),this.rest=e.substring(e.indexOf(",")+1)}}class s4{constructor(e,t){let r=0,n="";sz(e)?(this.data_=e,r=e.size,n=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_=n}size(){return this.size_}type(){return this.type_}slice(e,t){if(!sz(this.data_))return new s4(new Uint8Array(this.data_.buffer,e,t-e),!0);{var r,n,i;let s=(r=this.data_,n=e,i=t,r.webkitSlice?r.webkitSlice(n,i):r.mozSlice?r.mozSlice(n,i):r.slice?r.slice(n,i):null);return null===s?null:new s4(s)}}static getBlob(...e){if(sq()){let t=e.map(e=>e instanceof s4?e.data_:e);return new s4(sZ.apply(null,t))}{let t=e.map(e=>sW(e)?s1(sQ.RAW,e).data:e.data_),r=0;t.forEach(e=>{r+=e.byteLength});let n=new Uint8Array(r),i=0;return t.forEach(e=>{for(let t=0;t<e.length;t++)n[i++]=e[t]}),new s4(n,!0)}}uploadData(){return this.data_}}function s5(e){var t;let r;try{r=JSON.parse(e)}catch(e){return null}return"object"!=typeof(t=r)||Array.isArray(t)?null:r}function s8(e){let t=e.lastIndexOf("/",e.length-2);return -1===t?e:e.slice(t+1)}function s9(e,t){return t}class s7{constructor(e,t,r,n){this.server=e,this.local=t||e,this.writable=!!r,this.xform=n||s9}}let ae=null;function at(){if(ae)return ae;let e=[];e.push(new s7("bucket")),e.push(new s7("generation")),e.push(new s7("metageneration")),e.push(new s7("name","fullPath",!0));let t=new s7("name");t.xform=function(e,t){return!sW(t)||t.length<2?t:s8(t)},e.push(t);let r=new s7("size");return r.xform=function(e,t){return void 0!==t?Number(t):t},e.push(r),e.push(new s7("timeCreated")),e.push(new s7("updated")),e.push(new s7("md5Hash",null,!0)),e.push(new s7("cacheControl",null,!0)),e.push(new s7("contentDisposition",null,!0)),e.push(new s7("contentEncoding",null,!0)),e.push(new s7("contentLanguage",null,!0)),e.push(new s7("contentType",null,!0)),e.push(new s7("metadata","customMetadata",!0)),ae=e}function ar(e,t,r){let n=s5(t);return null===n?null:function(e,t,r){let n={};n.type="file";let i=r.length;for(let e=0;e<i;e++){let i=r[e];n[i.local]=i.xform(n,t[i.server])}return Object.defineProperty(n,"ref",{get:function(){let t=new sj(n.bucket,n.fullPath);return e._makeStorageReference(t)}}),n}(e,n,r)}function an(e,t){let r={},n=t.length;for(let i=0;i<n;i++){let n=t[i];n.writable&&(r[n.server]=e[n.local])}return JSON.stringify(r)}let ai="prefixes",as="items";class aa{constructor(e,t,r,n){this.url=e,this.method=t,this.handler=r,this.timeout=n,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function ao(e){if(!e)throw sN()}function al(e,t){return function(r,n){let i=ar(e,n,t);return ao(null!==i),i}}function ac(e){return function(t,r){var n,i;let s;return 401===t.getStatus()?s=t.getErrorText().includes("Firebase App Check token is invalid")?new sP(c.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new sP(c.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===t.getStatus()?(n=e.bucket,s=new sP(c.QUOTA_EXCEEDED,"Quota for bucket '"+n+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===t.getStatus()?(i=e.path,s=new sP(c.UNAUTHORIZED,"User does not have permission to access '"+i+"'.")):s=r,s.status=t.getStatus(),s.serverResponse=r.serverResponse,s}}function ah(e){let t=ac(e);return function(r,n){var i;let s=t(r,n);return 404===r.getStatus()&&(i=e.path,s=new sP(c.OBJECT_NOT_FOUND,"Object '"+i+"' does not exist.")),s.serverResponse=n.serverResponse,s}}function au(e,t,r){let n=sG(t.fullServerUrl(),e.host,e._protocol),i=e.maxOperationRetryTime,s=new aa(n,"GET",al(e,r),i);return s.errorHandler=ah(t),s}function ad(e,t,r){let n=Object.assign({},r);return n.fullPath=e.path,n.size=t.size(),n.contentType||(n.contentType=t&&t.type()||"application/octet-stream"),n}class ap{constructor(e,t,r,n){this.current=e,this.total=t,this.finalized=!!r,this.metadata=n||null}}function af(e,t){let r=null;try{r=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){ao(!1)}return ao(!!r&&-1!==(t||["active"]).indexOf(r)),r}let am={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function ag(e){switch(e){case"running":case"pausing":case"canceling":return am.RUNNING;case"paused":return am.PAUSED;case"success":return am.SUCCESS;case"canceled":return am.CANCELED;default:return am.ERROR}}class a_{constructor(e,t,r){(function(e){return"function"==typeof e})(e)||null!=t||null!=r?(this.next=e,this.error=t??void 0,this.complete=r??void 0):(this.next=e.next,this.error=e.error,this.complete=e.complete)}}function av(e){return(...t)=>{Promise.resolve().then(()=>e(...t))}}class ay{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=h.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=h.ABORT,e()}),this.xhr_.addEventListener("error",()=>
8{this.errorCode_=h.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,r,n,i){if(this.sent_)throw sH("cannot .send() more than once");if(z(e)&&r&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==i)for(let e in i)i.hasOwnProperty(e)&&this.xhr_.setRequestHeader(e,i[e].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw sH("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw sH("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return -1}}getResponse(){if(!this.sent_)throw sH("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw sH("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)}}class aw extends ay{initXhr(){this.xhr_.responseType="text"}}function aI(){return new aw}class ab{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}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=at(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=e=>{if(this._request=void 0,this._chunkMultiplier=1,e._codeEquals(c.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{let t=this.isExponentialBackoffExpired();if(sJ(e.status,[]))if(t)e=sD();else{this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,this.completeTransitions_();return}this._error=e,this._transition("error")}},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals(c.CANCELED)?this.completeTransitions_():(this._error=e,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){let e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>262144}_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.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,r])=>{switch(this._state){case"running":e(t,r);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((e,t)=>{var r,n,i,s,a;let o,l,c,h,u,d,p,f=(r=this._ref.storage,n=this._ref._location,i=this._mappings,s=this._blob,a=this._metadata,o=n.bucketOnlyServerUrl(),c={name:(l=ad(n,s,a)).fullPath},h=sG(o,r.host,r._protocol),u={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":l.contentType,"Content-Type":"application/json; charset=utf-8"},d=an(l,i),(p=new aa(h,"POST",function(e){let t;af(e);try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){ao(!1)}return ao(sW(t)),t},r.maxUploadRetryTime)).urlParams=c,p.headers=u,p.body=d,p.errorHandler=ac(n),p),m=this._ref.storage._makeRequest(f,aI,e,t);this._request=m,m.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){let e=this._uploadUrl;this._resolveToken((t,r)=>{var n,i,s;let a,o=(n=this._ref.storage,i=this._ref._location,s=this._blob,(a=new aa(e,"POST",function(e){let t=af(e,["active","final"]),r=null;try{r=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){ao(!1)}r||ao(!1);let n=Number(r);return ao(!isNaN(n)),new ap(n,s.size(),"final"===t)},n.maxUploadRetryTime)).headers={"X-Goog-Upload-Command":"query"}
8,a.errorHandler=ac(i),a),l=this._ref.storage._makeRequest(o,aI,t,r);this._request=l,l.getPromise().then(e=>{this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){let e=262144*this._chunkMultiplier,t=new ap(this._transferred,this._blob.size()),r=this._uploadUrl;this._resolveToken((n,i)=>{let s;try{s=function(e,t,r,n,i,s,a,o){let l=new ap(0,0);if(a?(l.current=a.current,l.total=a.total):(l.current=0,l.total=n.size()),n.size()!==l.total)throw new sP(c.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");let h=l.total-l.current,u=h;i>0&&(u=Math.min(u,i));let d=l.current,p=d+u,f={"X-Goog-Upload-Command":0===u?"finalize":h===u?"upload, finalize":"upload","X-Goog-Upload-Offset":`${l.current}`},m=n.slice(d,p);if(null===m)throw sU();let g=new aa(r,"POST",function(e,r){let i,a=af(e,["active","final"]),o=l.current+u,c=n.size();return i="final"===a?al(t,s)(e,r):null,new ap(o,c,"final"===a,i)},t.maxUploadRetryTime);return g.headers=f,g.body=m.uploadData(),g.progressCallback=o||null,g.errorHandler=ac(e),g}(this._ref._location,this._ref.storage,r,this._blob,e,this._mappings,t,this._makeProgressCallback())}catch(e){this._error=e,this._transition("error");return}let a=this._ref.storage._makeRequest(s,aI,n,i,!1);this._request=a,a.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(){2*(262144*this._chunkMultiplier)<0x2000000&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{let r=au(this._ref.storage,this._ref._location,this._mappings),n=this._ref.storage._makeRequest(r,aI,e,t);this._request=n,n.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{let r=function(e,t,r,n,i){let s=t.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},o=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();a["Content-Type"]="multipart/related; boundary="+o;let l=ad(t,n,i),c="--"+o+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+an(l,r)+"\r\n--"+o+"\r\nContent-Type: "+l.contentType+"\r\n\r\n",h=s4.getBlob(c,n,"\r\n--"+o+"--");if(null===h)throw sU();let u={name:l.fullPath},d=sG(s,e.host,e._protocol),p=e.maxUploadRetryTime,f=new aa(d,"POST",al(e,r),p);return f.urlParams=u,f.headers=a,f.body=h.uploadData(),f.errorHandler=ac(t),f}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),n=this._ref.storage._makeRequest(r,aI,e,t);this._request=n,n.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){let 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():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":let t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=e,this._notifyObservers();break;case"canceled":this._error=sL(),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(){let e=ag(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,r,n){let i=new a_(t||void 0,r||void 0,n||void 0);return this._addObserver(i),()=>{this._removeObserver(i)}}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){let t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEac
8h(e=>{this._notifyObserver(e)})}_finishPromise(){if(void 0!==this._resolve){let e=!0;switch(ag(this._state)){case am.SUCCESS:av(this._resolve.bind(null,this.snapshot))();break;case am.CANCELED:case am.ERROR:av(this._reject.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(ag(this._state)){case am.RUNNING:case am.PAUSED:e.next&&av(e.next.bind(e,this.snapshot))();break;case am.SUCCESS:e.complete&&av(e.complete.bind(e))();break;case am.CANCELED:case am.ERROR:default:e.error&&av(e.error.bind(e,this._error))()}}resume(){let e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e}pause(){let e="running"===this._state;return e&&this._transition("pausing"),e}cancel(){let e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e}}class aT{constructor(e,t){this._service=e,t instanceof sj?this._location=t:this._location=sj.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new aT(e,t)}get root(){let e=new sj(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return s8(this._location.path)}get storage(){return this._service}get parent(){let e=function(e){if(0===e.length)return null;let t=e.lastIndexOf("/");return -1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;let t=new sj(this._location.bucket,e);return new aT(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw sF(e)}}async function aE(e,t,r){let n=await ak(e,{pageToken:r});t.prefixes.push(...n.prefixes),t.items.push(...n.items),null!=n.nextPageToken&&await aE(e,t,n.nextPageToken)}function ak(e,t){var r,n,i,s,a;let o,l,c,h;null!=t&&"number"==typeof t.maxResults&&s$("options.maxResults",1,1e3,t.maxResults);let u=t||{},d=(r=e.storage,n=e._location,i=u.pageToken,s=u.maxResults,o={},n.isRoot?o.prefix="":o.prefix=n.path+"/",o.delimiter="/",i&&(o.pageToken=i),s&&(o.maxResults=s),l=sG(n.bucketOnlyServerUrl(),r.host,r._protocol),c=r.maxOperationRetryTime,(h=new aa(l,"GET",(a=n.bucket,function(e,t){let n=function(e,t,r){let n=s5(r);if(null===n)return null;let i={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n[ai])for(let r of n[ai]){let n=r.replace(/\/$/,""),s=e._makeStorageReference(new sj(t,n));i.prefixes.push(s)}if(n[as])for(let r of n[as]){let n=e._makeStorageReference(new sj(t,r.name));i.items.push(n)}return i}(r,a,t);return ao(null!==n),n}),c)).urlParams=o,h.errorHandler=ac(n),h);return e.storage.makeRequestWithTokens(d,aI)}function aR(e,t){var r;let n,i=(r=e._location.path,n=t.split("/").filter(e=>e.length>0).join("/"),0===r.length?n:r+"/"+n),s=new sj(e._location.bucket,i);return new aT(e.storage,s)}function aS(e,t){let r=t?.[sC];return null==r?null:sj.makeFromBucketSpec(r,e)}class aA{constructor(e,t,r,n,i,s=!1){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=n,this._firebaseVersion=i,this._isUsingEmulator=s,this._bucket=null,this._host=sA,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,null!=n?this._bucket=sj.makeFromBucketSpec(n,this._host):this._bucket=aS(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=sj.makeFromBucketSpec(this._url,e):this._bucket=aS(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){s$("time",0,1/0,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){s$("time",0,1/0,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let e=this._authProvider.getImmediate({optional:!0});if(e){let t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){if(eP(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=this._appCheckProvider.getImmediate({optional:!0});
8return 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 aT(this,e)}_makeRequest(e,t,r,n,i=!0){if(this._deleted)return new sB(sx());{let s=function(e,t,r,n,i,s,a=!0,o=!1){let l=sK(e.urlParams),c=e.url+l,h=Object.assign({},e.headers);return t&&(h["X-Firebase-GMPID"]=t),null!==r&&r.length>0&&(h.Authorization="Firebase "+r),h["X-Firebase-Storage-Version"]="webjs/"+(s??"AppManager"),null!==n&&(h["X-Firebase-AppCheck"]=n),new sY(c,e.method,h,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i,a,o)}(e,this._appId,r,n,t,this._firebaseVersion,i,this._isUsingEmulator);return this._requests.add(s),s.getPromise().then(()=>this._requests.delete(s),()=>this._requests.delete(s)),s}}async makeRequestWithTokens(e,t){let[r,n]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,r,n).getPromise()}}let aC="@firebase/storage",aP="0.14.3";function aO(e,t){var r=e=W(e);if(!(t&&/^[A-Za-z]+:\/\//.test(t)))return function e(t,r){if(t instanceof aA){if(null==t._bucket)throw new sP(c.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+sC+"' property when initializing the app?");let n=new aT(t,t._bucket);return null!=r?e(n,r):n}return void 0!==r?aR(t,r):t}(r,t);if(r instanceof aA)return new aT(r,t);throw sM("To use ref(service, url), the first argument must be a Storage instance.")}ek(new $("storage",function(e,{instanceIdentifier:t}){return new aA(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),t,eM)},"PUBLIC").setMultipleInstances(!0)),eB(aC,aP,""),eB(aC,aP,"esm2020");class aN{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 aD{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 aN(this._delegate.snapshot,this,this._ref)}then(e,t){return this._delegate.then(t=>{if(e)return e(new aN(t,this,this._ref))},t)}on(e,t,r,n){let i;return t&&(i="function"==typeof t?e=>t(new aN(e,this,this._ref)):{next:t.next?e=>t.next(new aN(e,this,this._ref)):void 0,complete:t.complete||void 0,error:t.error||void 0}),this._delegate.on(e,i,r||void 0,n||void 0)}}class aL{constructor(e,t){this._delegate=e,this._service=t}get prefixes(){return this._delegate.prefixes.map(e=>new aU(e,this._service))}get items(){return this._delegate.items.map(e=>new aU(e,this._service))}get nextPageToken(){return this._delegate.nextPageToken||null}}class aU{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){return new aU(aR(this._delegate,e),this.storage)}get root(){return new aU(this._delegate.root,this.storage)}get parent(){let e=this._delegate.parent;return null==e?null:new aU(e,this.storage)}put(e,t){var r,n;return this._throwIfRoot("put"),new aD((r=this._delegate,n=r=W(r),n._throwIfRoot("uploadBytesResumable"),new ab(n,new s4(e),t)),this)}putString(e,t=sQ.RAW,r){this._throwIfRoot("putString");let n=s1(t,e),i={...r};return null==i.contentType&&null!=n.contentType&&(i.contentType=n.contentType),new aD(new ab(this._delegate,new s4(n.data,!0),i),this)}listAll(){var e;let t;return(e=this._delegate,t={prefixes:[],items:[]},aE(e=W(e),t).then(()=>t)).then(e=>new aL(e,this.storage))}list(e){var t,r;return(t=this._delegate,r=e||void 0,ak(t=W(t),r)).then(e=>new aL(e,this.storage))}getMetadata(){var e;let t;return(e=W(this._delegate))._throwIfRoot("getMetadata"),t=au(e.storage,e._location,at()),e.storage.makeRequestWithTokens(t,aI)}updateMetadata(e){var t,r,n,i,s;let a,o,l,c,h;return t=this._delegate,r=t=W(t),r._throwIfRoot("updateMetadata"),n=r.storage,i=r._location,s=at(),a=sG(i.fullServerUrl(),n.host,n._protocol),o=an(e,s),l=n.maxOperationRetryTime,(c=new aa(a,"PATCH",al(n,s),l)).headers={"Content-Type":"application/json; charset=utf-8"},c.body=o,c.errorHandler=ah(i),h=c,r.storage.makeRequestWithTokens(h,aI)}getDownloadURL(){var e,t,r,n;let i,s,a,o;return(e=W(this._delegate))._throwIfRoot("getDownloadURL"),t=e.storage,r=e._location,n=at(),i=sG(r.fullServerUrl(),t.host,t._protocol),s=t.maxOperationRetryTime,(a=new aa(i,"GET",function(e,r){let i=ar(t,r,n);return ao(null!==i),function(e,t,r,n){let i=s5(t);if(null===i||!sW(i.downloadTokens))return null;let s=i.downloadTokens;if(0===s.length)return null;let a=encodeURIComponent;return s.split(",").map(t=>{let i=e.bucket,s=e.fullPath;return sG("/b/"+a(i)+"/o/"+a(s),r,n)+sK({alt:"media",token:t})})[0]}(i,r,t.host,t._protocol)},s)).errorHandler=ah(r),o=a,e.storage.makeRequestWithTokens(o,aI).then(e=>{if(null===e)throw new sP(c.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e})}delete(){var e,t,r;let n,i;return this._throwIfRoot("delete"),(e=W(this._delegate))._throwIfRoot("deleteObject"),t=e.storage,(n=new aa(sG((r=e._location).fullServerUrl(),t.host,t._protocol),"DELETE",function(e,t){},t.maxOperationRetryTime)).successCodes=[200,204],n.errorHandler=ah(r),i=n,e.storage.makeRequestWithTokens(i,aI)}_throwIfRoot(e){if(""===this._delegate._location.path)throw sF(e)}}class aM{constructor(e,t){this.app=e,this._delegate=t}get maxOperationRetryTime(){return this._delegate.maxOperationRetryTime}get maxUploadRetryTime(){return this._delegate.maxUploadRetryTime}ref(e){if(ax(e))throw sM("ref() expected a child path but got a URL, use refFromURL instead.");return new aU(aO(this._delegate,e),this)}refFromURL(e){if(!ax(e))throw sM("refFromURL() expected a full URL but got a child path, use ref() instead.");try{sj.makeFromUrl(e,this._delegate.host)}catch(e){throw sM("refFromUrl() expected a valid full URL but got an invali
8d one.")}return new aU(aO(this._delegate,e),this)}setMaxUploadRetryTime(e){this._delegate.maxUploadRetryTime=e}setMaxOperationRetryTime(e){this._delegate.maxOperationRetryTime=e}useEmulator(e,t,r={}){!function(e,t,r,n={}){!function(e,t,r,n={}){e.host=`${t}:${r}`;let i=z(t);i&&q(`https://${e.host}/b`),e._isUsingEmulator=!0,e._protocol=i?"https":"http";let{mockUserToken:s}=n;s&&(e._overrideAuthToken="string"==typeof s?s:function(e,t){if(e.uid)throw Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let r=t||"demo-project",n=e.iat||0,i=e.sub||e.user_id;if(!i)throw Error("mockUserToken must contain 'sub' or 'user_id' field!");let s={iss:`https://securetoken.google.com/${r}`,aud:r,iat:n,exp:n+3600,auth_time:n,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}},...e};return[_(JSON.stringify({alg:"none",type:"JWT"})),_(JSON.stringify(s)),""].join(".")}(s,e.app.options.projectId))}(e,t,r,n)}(this._delegate,e,t,r)}}function ax(e){return/^[A-Za-z]+:\/\//.test(e)}e3.INTERNAL.registerComponent(new $("storage-compat",function(e,{instanceIdentifier:t}){return new aM(e.getProvider("app-compat").getImmediate(),e.getProvider("storage").getImmediate({identifier:t}))},"PUBLIC").setServiceProps({TaskState:am,TaskEvent:{STATE_CHANGED:"state_changed"},StringFormat:sQ,Storage:aM,Reference:aU}).setMultipleInstances(!0)),e3.registerVersion("@firebase/storage-compat","0.4.3"),e3.initializeApp(JSON.parse('{"apiKey":"AIzaSyAc7S87wGmAtvSy_i9M2hbYeLHBZhTpeqA","authDomain":"auth.thefamilytree.app","projectId":"the-family-tree-app","appId":"1:828009626691:web:45f0f7e003881833f568f6"}'));let aF=e3.auth(),aV=e3.storage();if(u.default.env.FIREBASE_AUTH_EMULATOR_HOST&&aF.useEmulator(u.default.env.FIREBASE_AUTH_EMULATOR_HOST),u.default.env.FIREBASE_STORAGE_EMULATOR_HOST){let e=u.default.env.FIREBASE_STORAGE_EMULATOR_HOST.split(":"),t=e.pop(),r=e.join(":").replace("http://","");aV.useEmulator(r,parseInt(t||"",10))}e.s(["auth",0,aF],62733)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.