ozmoz 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +230 -0
- package/dist/cli.cjs +475 -0
- package/dist/index.js +319 -0
- package/dist/ozmoz-mcp.js +197 -0
- package/dist/ozmoz.iife.js +319 -0
- package/index.d.ts +131 -0
- package/package.json +39 -0
- package/scripts/setup-lib.cjs +748 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
var Jo=Object.defineProperty;var U=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var Jr=(t,e)=>{for(var n in e)Jo(t,n,{get:e[n],enumerable:!0})};var Yr,Xr=U(()=>{Yr=()=>{}});function Zo(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}function S(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function ni(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(S())}function ri(){return typeof window<"u"||yn()}function yn(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function ii(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function si(){let t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function oi(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function ai(){let t=S();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function ci(){try{return typeof indexedDB=="object"}catch{return!1}}function li(){return new Promise((t,e)=>{try{let n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{e(i.error?.message||"")}}catch(n){e(n)}})}function ra(t,e){return t.replace(ia,(n,r)=>{let i=e[r];return i!=null?String(i):`<${r}?>`})}function ui(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function ne(t,e){if(t===e)return!0;let n=Object.keys(t),r=Object.keys(e);for(let i of n){if(!r.includes(i))return!1;let s=t[i],a=e[i];if(Zr(s)&&Zr(a)){if(!ne(s,a))return!1}else if(s!==a)return!1}for(let i of r)if(!n.includes(i))return!1;return!0}function Zr(t){return t!==null&&typeof t=="object"}function ue(t){let e=[];for(let[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function Te(t){let e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){let[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function ve(t){let e=t.indexOf("?");if(!e)return"";let n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function di(t,e){let n=new mn(t,e);return n.subscribe.bind(n)}function sa(t,e){if(typeof t!="object"||t===null)return!1;for(let n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function fn(){}function p(t){return t&&t._delegate?t._delegate:t}function ft(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function hi(t){return(await fetch(t,{credentials:"include"})).ok}var Qr,Yo,ei,pn,Xo,gn,He,Qo,ea,ta,_n,ti,ht,In,we,na,L,G,ia,mn,Wu,Ae=U(()=>{Xr();Qr=function(t){let e=[],n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},Yo=function(t){let e=[],n=0,r=0;for(;n<t.length;){let i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){let s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){let s=t[n++],a=t[n++],c=t[n++],l=((i&7)<<18|(s&63)<<12|(a&63)<<6|c&63)-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(l&1023))}else{let s=t[n++],a=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|a&63)}}return e.join("")},ei={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:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();let n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<t.length;i+=3){let s=t[i],a=i+1<t.length,c=a?t[i+1]:0,l=i+2<t.length,o=l?t[i+2]:0,d=s>>2,f=(s&3)<<4|c>>4,h=(c&15)<<2|o>>6,I=o&63;l||(I=64,a||(h=64)),r.push(n[d],n[f],n[h],n[I])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Qr(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):Yo(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();let n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<t.length;){let s=n[t.charAt(i++)],c=i<t.length?n[t.charAt(i)]:0;++i;let o=i<t.length?n[t.charAt(i)]:64;++i;let f=i<t.length?n[t.charAt(i)]:64;if(++i,s==null||c==null||o==null||f==null)throw new pn;let h=s<<2|c>>4;if(r.push(h),o!==64){let I=c<<4&240|o>>2;if(r.push(I),f!==64){let b=o<<6&192|f;r.push(b)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},pn=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},Xo=function(t){let e=Qr(t);return ei.encodeByteArray(e,!0)},gn=function(t){return Xo(t).replace(/\./g,"")},He=function(t){try{return ei.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};Qo=()=>Zo().__FIREBASE_DEFAULTS__,ea=()=>{if(typeof process>"u"||typeof process.env>"u")return;let t=process.env.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},ta=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=t&&He(t[1]);return e&&JSON.parse(e)},_n=()=>{try{return Yr()||Qo()||ea()||ta()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},ti=t=>_n()?.emulatorHosts?.[t],ht=()=>_n()?.config,In=t=>_n()?.[`_${t}`];we=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}};na="FirebaseError",L=class t extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=na,Object.setPrototypeOf(this,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,G.prototype.create)}},G=class{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){let r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?ra(s,r):"Error",c=`${this.serviceName}: ${a} (${i}).`;return new L(i,c,r)}};ia=/\{\$([^}]+)}/g;mn=class{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");sa(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=fn),i.error===void 0&&(i.error=fn),i.complete===void 0&&(i.complete=fn);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};Wu=14400*1e3;});function oa(t){return t===de?void 0:t}function aa(t){return t.instantiationMode==="EAGER"}var H,de,bn,We,pt=U(()=>{Ae();H=class{constructor(e,n,r){this.name=e,this.instanceFactory=n,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}};de="[DEFAULT]";bn=class{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){let r=new we;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{let i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){let n=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}else{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(aa(e))try{this.getOrInitializeService({instanceIdentifier:de})}catch{}for(let[n,r]of this.instancesDeferred.entries()){let i=this.normalizeInstanceIdentifier(n);try{let s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=de){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(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=de){return this.instances.has(e)}getOptions(e=de){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:n={}}=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 i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(let[s,a]of this.instancesDeferred.entries()){let c=this.normalizeInstanceIdentifier(s);r===c&&a.resolve(i)}return i}onInit(e,n){let r=this.normalizeInstanceIdentifier(n),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);let s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){let r=this.onInitCallbacks.get(n);if(r)for(let i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:oa(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=de){return this.component?this.component.multipleInstances?e:de:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};We=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.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 n=new bn(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}});function pi(t){En.forEach(e=>{e.setLogLevel(t)})}function mi(t,e){for(let n of En){let r=null;e&&e.level&&(r=fi[e.level]),t===null?n.userLogHandler=null:n.userLogHandler=(i,s,...a)=>{let c=a.map(l=>{if(l==null)return null;if(typeof l=="string")return l;if(typeof l=="number"||typeof l=="boolean")return l.toString();if(l instanceof Error)return l.message;try{return JSON.stringify(l)}catch{return null}}).filter(l=>l).join(" ");s>=(r??i.logLevel)&&t({level:m[s].toLowerCase(),message:c,args:a,type:i.name})}}}var En,m,fi,ca,la,ua,Se,mt=U(()=>{En=[];(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(m||(m={}));fi={debug:m.DEBUG,verbose:m.VERBOSE,info:m.INFO,warn:m.WARN,error:m.ERROR,silent:m.SILENT},ca=m.INFO,la={[m.DEBUG]:"log",[m.VERBOSE]:"log",[m.INFO]:"info",[m.WARN]:"warn",[m.ERROR]:"error"},ua=(t,e,...n)=>{if(e<t.logLevel)return;let r=new Date().toISOString(),i=la[e];if(i)console[i](`[${r}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},Se=class{constructor(e){this.name=e,this._logLevel=ca,this._logHandler=ua,this._userLogHandler=null,En.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in m))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?fi[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new 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,m.DEBUG,...e),this._logHandler(this,m.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,m.VERBOSE,...e),this._logHandler(this,m.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,m.INFO,...e),this._logHandler(this,m.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,m.WARN,...e),this._logHandler(this,m.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,m.ERROR,...e),this._logHandler(this,m.ERROR,...e)}}});function ha(){return gi||(gi=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function fa(){return _i||(_i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}function pa(t){let e=new Promise((n,r)=>{let i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",a)},s=()=>{n(W(t.result)),i()},a=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",a)});return e.then(n=>{n instanceof IDBCursor&&Ii.set(n,t)}).catch(()=>{}),An.set(e,t),e}function ma(t){if(Tn.has(t))return;let e=new Promise((n,r)=>{let i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",a),t.removeEventListener("abort",a)},s=()=>{n(),i()},a=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",a),t.addEventListener("abort",a)});Tn.set(t,e)}function bi(t){vn=t(vn)}function ga(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){let r=t.call(gt(this),e,...n);return yi.set(r,e.sort?e.sort():[e]),W(r)}:fa().includes(t)?function(...e){return t.apply(gt(this),e),W(Ii.get(this))}:function(...e){return W(t.apply(gt(this),e))}}function _a(t){return typeof t=="function"?ga(t):(t instanceof IDBTransaction&&ma(t),da(t,ha())?new Proxy(t,vn):t)}function W(t){if(t instanceof IDBRequest)return pa(t);if(wn.has(t))return wn.get(t);let e=_a(t);return e!==t&&(wn.set(t,e),An.set(e,t)),e}var da,gi,_i,Ii,Tn,yi,wn,An,vn,gt,Sn=U(()=>{da=(t,e)=>e.some(n=>t instanceof n);Ii=new WeakMap,Tn=new WeakMap,yi=new WeakMap,wn=new WeakMap,An=new WeakMap;vn={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Tn.get(t);if(e==="objectStoreNames")return t.objectStoreNames||yi.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return W(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};gt=t=>An.get(t)});function wi(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){let a=indexedDB.open(t,e),c=W(a);return r&&a.addEventListener("upgradeneeded",l=>{r(W(a.result),l.oldVersion,l.newVersion,W(a.transaction),l)}),n&&a.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),c.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",o=>i(o.oldVersion,o.newVersion,o))}).catch(()=>{}),c}function Ei(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(kn.get(e))return kn.get(e);let n=e.replace(/FromIndex$/,""),r=e!==n,i=ya.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Ia.includes(n)))return;let s=async function(a,...c){let l=this.transaction(a,i?"readwrite":"readonly"),o=l.store;return r&&(o=o.index(c.shift())),(await Promise.all([o[n](...c),i&&l.done]))[0]};return kn.set(e,s),s}var Ia,ya,kn,Ti=U(()=>{Sn();Sn();Ia=["get","getKey","getAll","getAllKeys","count"],ya=["put","add","delete","clear"],kn=new Map;bi(t=>({...t,get:(e,n,r)=>Ei(e,n)||t.get(e,n,r),has:(e,n)=>!!Ei(e,n)||t.has(e,n)}))});function ba(t){return t.getComponent()?.type==="VERSION"}function On(t,e){try{t.container.addComponent(e)}catch(n){q.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Ja(t,e){t.container.addOrOverwriteComponent(e)}function he(t){let e=t.name;if(Pe.has(e))return q.debug(`There were multiple attempts to register component ${e}.`),!1;Pe.set(e,t);for(let n of re.values())On(n,t);for(let n of ke.values())On(n,t);return!0}function $e(t,e){let n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function Ya(t,e,n=Be){$e(t,e).clearInstance(n)}function Mn(t){return t.options!==void 0}function Pi(t){return Mn(t)?!1:"authIdToken"in t||"appCheckToken"in t||"releaseOnDeref"in t||"automaticDataCollectionEnabled"in t}function y(t){return t==null?!1:t.settings!==void 0}function Xa(){Pe.clear()}function vi(t,e){let n=He(t.split(".")[1]);if(n===null){console.error(`FirebaseServerApp ${e} is invalid: second part could not be parsed.`);return}if(JSON.parse(n).exp===void 0){console.error(`FirebaseServerApp ${e} is invalid: expiration claim could not be parsed`);return}let i=JSON.parse(n).exp*1e3,s=new Date().getTime();i-s<=0&&console.error(`FirebaseServerApp ${e} is invalid: the token has expired.`)}function Ri(t,e={}){let n=t;typeof e!="object"&&(e={name:e});let r={name:Be,automaticDataCollectionEnabled:!0,...e},i=r.name;if(typeof i!="string"||!i)throw N.create("bad-app-name",{appName:String(i)});if(n||(n=ht()),!n)throw N.create("no-options");let s=re.get(i);if(s){if(ne(n,s.options)&&ne(r,s.config))return s;throw N.create("duplicate-app",{appName:i})}let a=new We(i);for(let l of Pe.values())a.addComponent(l);let c=new It(n,r,a);return re.set(i,c),c}function Qa(t,e={}){if(ri()&&!yn())throw N.create("invalid-server-app-environment");let n,r=e||{};if(t&&(Mn(t)?n=t.options:Pi(t)?r=t:n=t),r.automaticDataCollectionEnabled===void 0&&(r.automaticDataCollectionEnabled=!0),n||(n=ht()),!n)throw N.create("no-options");let i={...r,...n};i.releaseOnDeref!==void 0&&delete i.releaseOnDeref;let s=d=>[...d].reduce((f,h)=>Math.imul(31,f)+h.charCodeAt(0)|0,0);if(r.releaseOnDeref!==void 0&&typeof FinalizationRegistry>"u")throw N.create("finalization-registry-not-supported",{});let a=""+s(JSON.stringify(i)),c=ke.get(a);if(c)return c.incRefCount(r.releaseOnDeref),c;let l=new We(a);for(let d of Pe.values())l.addComponent(d);let o=new Nn(n,r,a,l);return ke.set(a,o),o}function Un(t=Be){let e=re.get(t);if(!e&&t===Be&&ht())return Ri();if(!e)throw N.create("no-app",{appName:t});return e}function ec(){return Array.from(re.values())}async function Ci(t){let e=!1,n=t.name;re.has(n)?(e=!0,re.delete(n)):ke.has(n)&&t.decRefCount()<=0&&(ke.delete(n),e=!0),e&&(await Promise.all(t.container.getProviders().map(r=>r.delete())),t.isDeleted=!0)}function B(t,e,n){let r=Ka[t]??t;n&&(r+=`-${n}`);let i=r.match(/\s|\//),s=e.match(/\s|\//);if(i||s){let a=[`Unable to register library "${r}" with version "${e}":`];i&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),q.warn(a.join(" "));return}he(new H(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}function tc(t,e){if(t!==null&&typeof t!="function")throw N.create("invalid-log-argument");mi(t,e)}function nc(t){pi(t)}function Oi(){return Pn||(Pn=wi(rc,ic,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(ze)}catch(n){console.warn(n)}}}}).catch(t=>{throw N.create("idb-open",{originalErrorMessage:t.message})})),Pn}async function sc(t){try{let n=(await Oi()).transaction(ze),r=await n.objectStore(ze).get(Ni(t));return await n.done,r}catch(e){if(e instanceof L)q.warn(e.message);else{let n=N.create("idb-get",{originalErrorMessage:e?.message});q.warn(n.message)}}}async function Ai(t,e){try{let r=(await Oi()).transaction(ze,"readwrite");await r.objectStore(ze).put(e,Ni(t)),await r.done}catch(n){if(n instanceof L)q.warn(n.message);else{let r=N.create("idb-set",{originalErrorMessage:n?.message});q.warn(r.message)}}}function Ni(t){return`${t.name}!${t.options.appId}`}function Si(){return new Date().toISOString().substring(0,10)}function cc(t,e=oc){let n=[],r=t.slice();for(let i of t){let s=n.find(a=>a.agent===i.agent);if(s){if(s.dates.push(i.date),ki(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),ki(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}function ki(t){return gn(JSON.stringify({version:2,heartbeats:t})).length}function lc(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}function uc(t){he(new H("platform-logger",e=>new Rn(e),"PRIVATE")),he(new H("heartbeat",e=>new Dn(e),"PRIVATE")),B(_t,Cn,t),B(_t,Cn,"esm2020"),B("fire-js","")}var Rn,_t,Cn,q,Ea,wa,Ta,va,Aa,Sa,ka,Pa,Ra,Ca,Oa,Na,Da,La,Ma,Ua,Fa,xa,Va,Ha,Wa,Ba,za,$a,ja,Ga,qa,Be,Ka,re,ke,Pe,Za,N,It,Nn,fe,rc,ic,ze,Pn,oc,ac,Dn,Ln,je=U(()=>{pt();mt();Ae();Ae();Ti();Rn=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(ba(n)){let r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}};_t="@firebase/app",Cn="0.15.1";q=new Se("@firebase/app"),Ea="@firebase/app-compat",wa="@firebase/analytics-compat",Ta="@firebase/analytics",va="@firebase/app-check-compat",Aa="@firebase/app-check",Sa="@firebase/auth",ka="@firebase/auth-compat",Pa="@firebase/database",Ra="@firebase/data-connect",Ca="@firebase/database-compat",Oa="@firebase/functions",Na="@firebase/functions-compat",Da="@firebase/installations",La="@firebase/installations-compat",Ma="@firebase/messaging",Ua="@firebase/messaging-compat",Fa="@firebase/performance",xa="@firebase/performance-compat",Va="@firebase/remote-config",Ha="@firebase/remote-config-compat",Wa="@firebase/storage",Ba="@firebase/storage-compat",za="@firebase/firestore",$a="@firebase/ai",ja="@firebase/firestore-compat",Ga="firebase",qa="12.16.0";Be="[DEFAULT]",Ka={[_t]:"fire-core",[Ea]:"fire-core-compat",[Ta]:"fire-analytics",[wa]:"fire-analytics-compat",[Aa]:"fire-app-check",[va]:"fire-app-check-compat",[Sa]:"fire-auth",[ka]:"fire-auth-compat",[Pa]:"fire-rtdb",[Ra]:"fire-data-connect",[Ca]:"fire-rtdb-compat",[Oa]:"fire-fn",[Na]:"fire-fn-compat",[Da]:"fire-iid",[La]:"fire-iid-compat",[Ma]:"fire-fcm",[Ua]:"fire-fcm-compat",[Fa]:"fire-perf",[xa]:"fire-perf-compat",[Va]:"fire-rc",[Ha]:"fire-rc-compat",[Wa]:"fire-gcs",[Ba]:"fire-gcs-compat",[za]:"fire-fst",[ja]:"fire-fst-compat",[$a]:"fire-vertex","fire-js":"fire-js",[Ga]:"fire-js-all"};re=new Map,ke=new Map,Pe=new Map;Za={"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.","invalid-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."},N=new G("app","Firebase",Za);It=class{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new H("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 N.create("app-deleted",{appName:this._name})}};Nn=class extends It{constructor(e,n,r,i){let s=n.automaticDataCollectionEnabled!==void 0?n.automaticDataCollectionEnabled:!0,a={name:r,automaticDataCollectionEnabled:s};if(e.apiKey!==void 0)super(e,a,i);else{let c=e;super(c.options,a,i)}this._serverConfig={automaticDataCollectionEnabled:s,...n},this._serverConfig.authIdToken&&vi(this._serverConfig.authIdToken,"authIdToken"),this._serverConfig.appCheckToken&&vi(this._serverConfig.appCheckToken,"appCheckToken"),this._finalizationRegistry=null,typeof FinalizationRegistry<"u"&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,n.releaseOnDeref=void 0,B(_t,Cn,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,e!==void 0&&this._finalizationRegistry!==null&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){Ci(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw N.create("server-app-deleted")}};fe=qa;rc="firebase-heartbeat-database",ic=1,ze="firebase-heartbeat-store",Pn=null;oc=1024,ac=30,Dn=class{constructor(e){this.container=e,this._heartbeatsCache=null;let n=this.container.getProvider("app").getImmediate();this._storage=new Ln(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){try{let n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=Si();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats.length>ac){let i=lc(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){q.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";let e=Si(),{heartbeatsToSend:n,unsentEntries:r}=cc(this._heartbeatsCache.heartbeats),i=gn(JSON.stringify({version:2,heartbeats:n}));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)),i}catch(e){return q.warn(e),""}}};Ln=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return ci()?li().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){let n=await sc(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){let r=await this.read();return Ai(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){let r=await this.read();return Ai(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}};uc("")});var Di={};Jr(Di,{FirebaseError:()=>L,SDK_VERSION:()=>fe,_DEFAULT_ENTRY_NAME:()=>Be,_addComponent:()=>On,_addOrOverwriteComponent:()=>Ja,_apps:()=>re,_clearComponents:()=>Xa,_components:()=>Pe,_getProvider:()=>$e,_isFirebaseApp:()=>Mn,_isFirebaseServerApp:()=>y,_isFirebaseServerAppSettings:()=>Pi,_registerComponent:()=>he,_removeServiceInstance:()=>Ya,_serverApps:()=>ke,deleteApp:()=>Ci,getApp:()=>Un,getApps:()=>ec,initializeApp:()=>Ri,initializeServerApp:()=>Qa,onLog:()=>tc,registerVersion:()=>B,setLogLevel:()=>nc});var dc,hc,Li=U(()=>{je();je();dc="firebase",hc="12.16.0";B(dc,hc,"app")});function fc(){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`)."}}function os(){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."}}function pc(t,...e){At.logLevel<=m.WARN&&At.warn(`Auth (${fe}): ${t}`,...e)}function Et(t,...e){At.logLevel<=m.ERROR&&At.error(`Auth (${fe}): ${t}`,...e)}function R(t,...e){throw Ir(t,...e)}function k(t,...e){return Ir(t,...e)}function _r(t,e,n){let r={...gr(),[e]:n};return new G("auth","Firebase",r).create(e,{appName:t.name})}function A(t){return _r(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Ue(t,e,n){let r=n;if(!(e instanceof r))throw r.name!==e.constructor.name&&R(t,"argument-error"),_r(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Ir(t,...e){if(typeof t!="string"){let n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return cs.create(t,...e)}function u(t,e,...n){if(!t)throw Ir(e,...n)}function z(t){let e="INTERNAL ASSERTION FAILED: "+t;throw Et(e),new Error(e)}function Y(t,e){t||z(e)}function Ze(){return typeof self<"u"&&self.location?.href||""}function yr(){return Mi()==="http:"||Mi()==="https:"}function Mi(){return typeof self<"u"&&self.location?.protocol||null}function mc(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(yr()||si()||"connection"in navigator)?navigator.onLine:!0}function gc(){if(typeof navigator>"u")return null;let t=navigator;return t.languages&&t.languages[0]||t.language||null}function br(t,e){Y(t.emulator,"Emulator should always be set here");let{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}function g(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function _(t,e,n,r,i={}){return us(t,i,async()=>{let s={},a={};r&&(e==="GET"?a=r:s={body:JSON.stringify(r)});let c=ue({...a,key:t.config.apiKey}).slice(1),l=await t._getAdditionalHeaders();l["Content-Type"]="application/json",t.languageCode&&(l["X-Firebase-Locale"]=t.languageCode);let o={method:e,headers:l,...s};return ii()||(o.referrerPolicy="strict-origin-when-cross-origin"),t.emulatorConfig&&ft(t.emulatorConfig.host)&&(o.credentials="include"),St.fetch()(await ds(t,t.config.apiHost,n,c),o)})}async function us(t,e,n){t._canInitEmulator=!1;let r={..._c,...e};try{let i=new $n(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();let a=await s.json();if("needConfirmation"in a)throw qe(t,"account-exists-with-different-credential",a);if(s.ok&&!("errorMessage"in a))return a;{let c=s.ok?a.errorMessage:a.error.message,[l,o]=c.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw qe(t,"credential-already-in-use",a);if(l==="EMAIL_EXISTS")throw qe(t,"email-already-in-use",a);if(l==="USER_DISABLED")throw qe(t,"user-disabled",a);let d=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw _r(t,d,o);R(t,d)}}catch(i){if(i instanceof L)throw i;R(t,"network-request-failed",{message:String(i)})}}async function ee(t,e,n,r,i={}){let s=await _(t,e,n,r,i);return"mfaPendingCredential"in s&&R(t,"multi-factor-auth-required",{_serverResponse:s}),s}async function ds(t,e,n,r){let i=`${e}${n}?${r}`,s=t,a=s.config.emulator?br(t.config,i):`${t.config.apiScheme}://${i}`;return Ic.includes(n)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(a).toString():a}function bc(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}function qe(t,e,n){let r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);let i=k(t,e,r);return i.customData._tokenResponse=n,i}function Ui(t){return t!==void 0&&t.getResponse!==void 0}function Fi(t){return t!==void 0&&t.enterprise!==void 0}async function Ec(t){return(await _(t,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function hs(t,e){return _(t,"GET","/v2/recaptchaConfig",g(t,e))}async function wc(t,e){return _(t,"POST","/v1/accounts:delete",e)}async function Tc(t,e){return _(t,"POST","/v1/accounts:update",e)}async function Pt(t,e){return _(t,"POST","/v1/accounts:lookup",e)}function Ke(t){if(t)try{let e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function fs(t,e=!1){return p(t).getIdToken(e)}async function Er(t,e=!1){let n=p(t),r=await n.getIdToken(e),i=Xt(r);u(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");let s=typeof i.firebase=="object"?i.firebase:void 0,a=s?.sign_in_provider;return{claims:i,token:r,authTime:Ke(Fn(i.auth_time)),issuedAtTime:Ke(Fn(i.iat)),expirationTime:Ke(Fn(i.exp)),signInProvider:a||null,signInSecondFactor:s?.sign_in_second_factor||null}}function Fn(t){return Number(t)*1e3}function Xt(t){let[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Et("JWT malformed, contained fewer than 3 sections"),null;try{let i=He(n);return i?JSON.parse(i):(Et("Failed to decode base64 JWT payload"),null)}catch(i){return Et("Caught error parsing JWT payload as JSON",i?.toString()),null}}function xi(t){let e=Xt(t);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}async function X(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof L&&vc(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function vc({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}async function et(t){let e=t.auth,n=await t.getIdToken(),r=await X(t,Pt(e,{idToken:n}));u(r?.users.length,e,"internal-error");let i=r.users[0];t._notifyReloadListener(i);let s=i.providerUserInfo?.length?ps(i.providerUserInfo):[],a=Ac(t.providerData,s),c=t.isAnonymous,l=!(t.email&&i.passwordHash)&&!a?.length,o=c?l:!1,d={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:a,metadata:new Qe(i.createdAt,i.lastLoginAt),isAnonymous:o};Object.assign(t,d)}async function wr(t){let e=p(t);await et(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Ac(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function ps(t){return t.map(({providerId:e,...n})=>({providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}async function Sc(t,e){let n=await us(t,{},async()=>{let r=ue({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,a=await ds(t,i,"/v1/token",`key=${s}`),c=await t._getAdditionalHeaders();c["Content-Type"]="application/x-www-form-urlencoded";let l={method:"POST",headers:c,body:r};return t.emulatorConfig&&ft(t.emulatorConfig.host)&&(l.credentials="include"),St.fetch()(a,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function kc(t,e){return _(t,"POST","/v2/accounts:revokeToken",g(t,e))}function ie(t,e){u(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}function K(t){Y(t instanceof Function,"Expected a class definition");let e=Vi.get(t);return e?(Y(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Vi.set(t,e),e)}function wt(t,e,n){return`firebase:${t}:${e}:${n}`}function Hi(t){let e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Is(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(ms(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(bs(e))return"Blackberry";if(Es(e))return"Webos";if(gs(e))return"Safari";if((e.includes("chrome/")||_s(e))&&!e.includes("edge/"))return"Chrome";if(ys(e))return"Android";{let n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if(r?.length===2)return r[1]}return"Other"}function ms(t=S()){return/firefox\//i.test(t)}function gs(t=S()){let e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function _s(t=S()){return/crios\//i.test(t)}function Is(t=S()){return/iemobile/i.test(t)}function ys(t=S()){return/android/i.test(t)}function bs(t=S()){return/blackberry/i.test(t)}function Es(t=S()){return/webos/i.test(t)}function Tr(t=S()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Pc(t=S()){return Tr(t)&&!!window.navigator?.standalone}function Rc(){return ai()&&document.documentMode===10}function ws(t=S()){return Tr(t)||ys(t)||Es(t)||bs(t)||/windows phone/i.test(t)||Is(t)}function Ts(t,e=[]){let n;switch(t){case"Browser":n=Hi(S());break;case"Worker":n=`${Hi(S())}-${t}`;break;default:n=t}let r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${fe}/${r}`}async function Cc(t,e={}){return _(t,"GET","/v2/passwordPolicy",g(t,e))}function E(t){return p(t)}function Nc(t){at=t}function vr(t){return at.loadJS(t)}function Dc(){return at.recaptchaV2Script}function Lc(){return at.recaptchaEnterpriseScript}function Mc(){return at.gapiScript}function vs(t){return`__${t}${Math.floor(Math.random()*1e6)}`}function xc(t){let e=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<t;r++)e.push(n.charAt(Math.floor(Math.random()*n.length)));return e.join("")}async function Ge(t,e,n,r=!1,i=!1){let s=new tt(t),a;if(i)a=Ye;else try{a=await s.verify(n)}catch{a=await s.verify(n,!0)}let c={...e};if(n==="mfaSmsEnrollment"||n==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in c){let l=c.phoneEnrollmentInfo.phoneNumber,o=c.phoneEnrollmentInfo.recaptchaToken;Object.assign(c,{phoneEnrollmentInfo:{phoneNumber:l,recaptchaToken:o,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in c){let l=c.phoneSignInInfo.recaptchaToken;Object.assign(c,{phoneSignInInfo:{recaptchaToken:l,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return c}return r?Object.assign(c,{captchaResp:a}):Object.assign(c,{captchaResponse:a}),Object.assign(c,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(c,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),c}async function oe(t,e,n,r,i){if(i==="EMAIL_PASSWORD_PROVIDER")if(t._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){let s=await Ge(t,e,n,n==="getOobCode");return r(t,s)}else return r(t,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let a=await Ge(t,e,n,n==="getOobCode");return r(t,a)}else return Promise.reject(s)});else if(i==="PHONE_PROVIDER")if(t._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){let s=await Ge(t,e,n);return r(t,s).catch(async a=>{if(t._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")==="AUDIT"&&(a.code==="auth/missing-recaptcha-token"||a.code==="auth/invalid-app-credential")){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${n} flow.`);let c=await Ge(t,e,n,!1,!0);return r(t,c)}return Promise.reject(a)})}else{let s=await Ge(t,e,n,!1,!0);return r(t,s)}else return Promise.reject(i+" provider is not supported.")}async function As(t){let e=E(t),n=await hs(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new kt(n);e.tenantId==null?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,r.isAnyProviderEnabled()&&new tt(e).verify()}function Ar(t,e){let n=$e(t,"auth");if(n.isInitialized()){let i=n.getImmediate(),s=n.getOptions();if(ne(s,e??{}))return i;R(i,"already-initialized")}return n.initialize({options:e})}function Hc(t,e){let n=e?.persistence||[],r=(Array.isArray(n)?n:[n]).map(K);e?.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e?.popupRedirectResolver)}function Sr(t,e,n){let r=E(t);u(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");let i=!!n?.disableWarnings,s=Ss(e),{host:a,port:c}=Wc(e),l=c===null?"":`:${c}`,o={url:`${s}//${a}${l}/`},d=Object.freeze({host:a,port:c,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){u(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),u(ne(o,r.config.emulator)&&ne(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=o,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,ft(a)?hi(`${s}//${a}${l}`):i||Bc()}function Ss(t){let e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function Wc(t){let e=Ss(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};let r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){let s=i[1];return{host:s,port:Bi(r.substr(s.length+1))}}else{let[s,a]=r.split(":");return{host:s,port:Bi(a)}}}function Bi(t){if(!t)return null;let e=Number(t);return isNaN(e)?null:e}function Bc(){function t(){let e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}async function ks(t,e){return _(t,"POST","/v1/accounts:resetPassword",g(t,e))}async function zc(t,e){return _(t,"POST","/v1/accounts:update",e)}async function $c(t,e){return _(t,"POST","/v1/accounts:signUp",e)}async function jc(t,e){return _(t,"POST","/v1/accounts:update",g(t,e))}async function Gc(t,e){return ee(t,"POST","/v1/accounts:signInWithPassword",g(t,e))}async function Zt(t,e){return _(t,"POST","/v1/accounts:sendOobCode",g(t,e))}async function qc(t,e){return Zt(t,e)}async function Kc(t,e){return Zt(t,e)}async function Jc(t,e){return Zt(t,e)}async function Yc(t,e){return Zt(t,e)}async function Xc(t,e){return ee(t,"POST","/v1/accounts:signInWithEmailLink",g(t,e))}async function Zc(t,e){return ee(t,"POST","/v1/accounts:signInWithEmailLink",g(t,e))}async function J(t,e){return ee(t,"POST","/v1/accounts:signInWithIdp",g(t,e))}async function zi(t,e){return _(t,"POST","/v1/accounts:sendVerificationCode",g(t,e))}async function el(t,e){return ee(t,"POST","/v1/accounts:signInWithPhoneNumber",g(t,e))}async function tl(t,e){let n=await ee(t,"POST","/v1/accounts:signInWithPhoneNumber",g(t,e));if(n.temporaryProof)throw qe(t,"account-exists-with-different-credential",n);return n}async function rl(t,e){let n={...e,operation:"REAUTH"};return ee(t,"POST","/v1/accounts:signInWithPhoneNumber",g(t,n),nl)}function il(t){switch(t){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}}function sl(t){let e=Te(ve(t)).link,n=e?Te(ve(e)).deep_link_id:null,r=Te(ve(t)).deep_link_id;return(r?Te(ve(r)).link:null)||r||n||e||t}function Ps(t){return ge.parseLink(t)}async function Rs(t,e){return ee(t,"POST","/v1/accounts:signUp",g(t,e))}function $i(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}async function Cs(t){if(y(t.app))return Promise.reject(A(t));let e=E(t);if(await e._initializationPromise,e.currentUser?.isAnonymous)return new x({user:e.currentUser,providerId:null,operationType:"signIn"});let n=await Rs(e,{returnSecureToken:!0}),r=await x._fromIdTokenResponse(e,"signIn",n,!0);return await e._updateCurrentUser(r.user),r}function Os(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?Qn._fromErrorAndOperation(t,s,e,r):s})}function Ns(t){return new Set(t.map(({providerId:e})=>e).filter(e=>!!e))}async function Ds(t,e){let n=p(t);await Qt(!0,n,e);let{providerUserInfo:r}=await Tc(n.auth,{idToken:await n.getIdToken(),deleteProvider:[e]}),i=Ns(r||[]);return n.providerData=n.providerData.filter(s=>i.has(s.providerId)),i.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}async function kr(t,e,n=!1){let r=await X(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return x._forOperation(t,"link",r)}async function Qt(t,e,n){await et(e);let r=Ns(e.providerData),i=t===!1?"provider-already-linked":"no-such-provider";u(r.has(n)===t,e.auth,i)}async function Ls(t,e,n=!1){let{auth:r}=t;if(y(r.app))return Promise.reject(A(r));let i="reauthenticate";try{let s=await X(t,Os(r,i,e,t),n);u(s.idToken,r,"internal-error");let a=Xt(s.idToken);u(a,r,"internal-error");let{sub:c}=a;return u(t.uid===c,r,"user-mismatch"),x._forOperation(t,i,s)}catch(s){throw s?.code==="auth/user-not-found"&&R(r,"user-mismatch"),s}}async function Ms(t,e,n=!1){if(y(t.app))return Promise.reject(A(t));let r="signIn",i=await Os(t,r,e),s=await x._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}async function ct(t,e){return Ms(E(t),e)}async function Pr(t,e){let n=p(t);return await Qt(!1,n,e.providerId),kr(n,e)}async function Rr(t,e){return Ls(p(t),e)}async function cl(t,e){return ee(t,"POST","/v1/accounts:signInWithCustomToken",g(t,e))}async function Us(t,e){if(y(t.app))return Promise.reject(A(t));let n=E(t),r=await cl(n,{token:e,returnSecureToken:!0}),i=await x._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(i.user),i}function en(t,e,n){u(n.url?.length>0,t,"invalid-continue-uri"),u(typeof n.dynamicLinkDomain>"u"||n.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),u(typeof n.linkDomain>"u"||n.linkDomain.length>0,t,"invalid-hosting-link-domain"),e.continueUrl=n.url,e.dynamicLinkDomain=n.dynamicLinkDomain,e.linkDomain=n.linkDomain,e.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(u(n.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=n.iOS.bundleId),n.android&&(u(n.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=n.android.installApp,e.androidMinimumVersionCode=n.android.minimumVersion,e.androidPackageName=n.android.packageName)}async function Cr(t){let e=E(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function Fs(t,e,n){let r=E(t),i={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};n&&en(r,i,n),await oe(r,i,"getOobCode",Kc,"EMAIL_PASSWORD_PROVIDER")}async function xs(t,e,n){await ks(p(t),{oobCode:e,newPassword:n}).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Cr(t),r})}async function Vs(t,e){await jc(p(t),{oobCode:e})}async function Or(t,e){let n=p(t),r=await ks(n,{oobCode:e}),i=r.requestType;switch(u(i,n,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":u(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":u(r.mfaInfo,n,"internal-error");default:u(r.email,n,"internal-error")}let s=null;return r.mfaInfo&&(s=_e._fromServerResponse(E(n),r.mfaInfo)),{data:{email:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.newEmail:r.email)||null,previousEmail:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.email:r.newEmail)||null,multiFactorInfo:s},operation:i}}async function Hs(t,e){let{data:n}=await Or(p(t),e);return n.email}async function Ws(t,e,n){if(y(t.app))return Promise.reject(A(t));let r=E(t),a=await oe(r,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Rs,"EMAIL_PASSWORD_PROVIDER").catch(l=>{throw l.code==="auth/password-does-not-meet-requirements"&&Cr(t),l}),c=await x._fromIdTokenResponse(r,"signIn",a);return await r._updateCurrentUser(c.user),c}function Bs(t,e,n){return y(t.app)?Promise.reject(A(t)):ct(p(t),Q.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Cr(t),r})}async function zs(t,e,n){let r=E(t),i={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function s(a,c){u(c.handleCodeInApp,r,"argument-error"),c&&en(r,a,c)}s(i,n),await oe(r,i,"getOobCode",Jc,"EMAIL_PASSWORD_PROVIDER")}function $s(t,e){return ge.parseLink(e)?.operation==="EMAIL_SIGNIN"}async function js(t,e,n){if(y(t.app))return Promise.reject(A(t));let r=p(t),i=Q.credentialWithLink(e,n||Ze());return u(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),ct(r,i)}async function ll(t,e){return _(t,"POST","/v1/accounts:createAuthUri",g(t,e))}async function Gs(t,e){let n=yr()?Ze():"http://localhost",r={identifier:e,continueUri:n},{signinMethods:i}=await ll(p(t),r);return i||[]}async function qs(t,e){let n=p(t),i={requestType:"VERIFY_EMAIL",idToken:await t.getIdToken()};e&&en(n.auth,i,e);let{email:s}=await qc(n.auth,i);s!==t.email&&await t.reload()}async function Ks(t,e,n){let r=p(t),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await t.getIdToken(),newEmail:e};n&&en(r.auth,s,n);let{email:a}=await Yc(r.auth,s);a!==t.email&&await t.reload()}async function ul(t,e){return _(t,"POST","/v1/accounts:update",e)}async function Js(t,{displayName:e,photoURL:n}){if(e===void 0&&n===void 0)return;let r=p(t),s={idToken:await r.getIdToken(),displayName:e,photoUrl:n,returnSecureToken:!0},a=await X(r,ul(r.auth,s));r.displayName=a.displayName||null,r.photoURL=a.photoUrl||null;let c=r.providerData.find(({providerId:l})=>l==="password");c&&(c.displayName=r.displayName,c.photoURL=r.photoURL),await r._updateTokensIfNecessary(a)}function Ys(t,e){let n=p(t);return y(n.auth.app)?Promise.reject(A(n.auth)):Zs(n,e,null)}function Xs(t,e){return Zs(p(t),null,e)}async function Zs(t,e,n){let{auth:r}=t,s={idToken:await t.getIdToken(),returnSecureToken:!0};e&&(s.email=e),n&&(s.password=n);let a=await X(t,zc(r,s));await t._updateTokensIfNecessary(a,!0)}function dl(t){if(!t)return null;let{providerId:e}=t,n=t.rawUserInfo?JSON.parse(t.rawUserInfo):{},r=t.isNewUser||t.kind==="identitytoolkit#SignupNewUserResponse";if(!e&&t?.idToken){let i=Xt(t.idToken)?.firebase?.sign_in_provider;if(i){let s=i!=="anonymous"&&i!=="custom"?i:null;return new ae(r,s)}}if(!e)return null;switch(e){case"facebook.com":return new nr(r,n);case"github.com":return new rr(r,n);case"google.com":return new ir(r,n);case"twitter.com":return new sr(r,n,t.screenName||null);case"custom":case"anonymous":return new ae(r,null);default:return new ae(r,e,n)}}function Qs(t){let{user:e,_tokenResponse:n}=t;return e.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:dl(n)}function eo(t,e){return p(t).setPersistence(e)}function to(t){return As(t)}async function no(t,e){return E(t).validatePassword(e)}function Nr(t,e,n,r){return p(t).onIdTokenChanged(e,n,r)}function Dr(t,e,n){return p(t).beforeAuthStateChanged(e,n)}function ro(t,e,n,r){return p(t).onAuthStateChanged(e,n,r)}function io(t){p(t).useDeviceLanguage()}function so(t,e){return p(t).updateCurrentUser(e)}function oo(t){return p(t).signOut()}function ao(t,e){return E(t).revokeAccessToken(e)}async function co(t){return p(t).delete()}function lo(t,e){let n=p(t),r=e;return u(e.customData.operationType,n,"argument-error"),u(r.customData._serverResponse?.mfaPendingCredential,n,"argument-error"),or._fromError(n,r)}function ji(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:start",g(t,e))}function hl(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:finalize",g(t,e))}function fl(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:start",g(t,e))}function pl(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:finalize",g(t,e))}function ml(t,e){return _(t,"POST","/v2/accounts/mfaEnrollment:withdraw",g(t,e))}function uo(t){let e=p(t);return xn.has(e)||xn.set(e,ar._fromUser(e)),xn.get(e)}function Vn(t){let e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),n=RegExp(`${e}=([^;]+)`);return document.cookie.match(n)?.[1]??null}function Hn(t){return`${window.location.protocol==="http:"?"__dev_":"__HOST-"}FIREBASE_${t.split(":")[3]}`}function yl(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}function nn(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}function w(){return window}function bl(t){w().location.href=t}function Mr(){return typeof w().WorkerGlobalScope<"u"&&typeof w().importScripts=="function"}async function El(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function wl(){return navigator?.serviceWorker?.controller||null}function Tl(){return Mr()?self:null}function rn(t,e){return t.transaction([$t],e?"readwrite":"readonly").objectStore($t)}function Al(){let t=indexedDB.deleteDatabase(fo);return new Ie(t).toPromise()}function mo(){let t=indexedDB.open(fo,vl);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{let r=t.result;try{r.createObjectStore($t,{keyPath:po})}catch(i){n(i)}}),t.addEventListener("success",async()=>{let r=t.result;r.objectStoreNames.contains($t)?e(r):(r.close(),await Al(),e(await mo()))})})}async function Gi(t,e,n){let r=rn(t,!0).put({[po]:e,value:n});return new Ie(r).toPromise()}async function Sl(t,e){let n=rn(t,!1).get(e),r=await new Ie(n).toPromise();return r===void 0?null:r.value}function qi(t,e){let n=rn(t,!0).delete(e);return new Ie(n).toPromise()}function Ki(t,e){return _(t,"POST","/v2/accounts/mfaSignIn:start",g(t,e))}function Rl(t,e){return _(t,"POST","/v2/accounts/mfaSignIn:finalize",g(t,e))}function Cl(t,e){return _(t,"POST","/v2/accounts/mfaSignIn:finalize",g(t,e))}function Nl(t){return t.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(t)}function Ll(){let t=null;return new Promise(e=>{if(document.readyState==="complete"){e();return}t=()=>e(),window.addEventListener("load",t)}).catch(e=>{throw t&&window.removeEventListener("load",t),e})}async function go(t,e,n){if(y(t.app))return Promise.reject(A(t));let r=E(t),i=await sn(r,e,p(n));return new nt(i,s=>ct(r,s))}async function _o(t,e,n){let r=p(t);await Qt(!1,r,"phone");let i=await sn(r.auth,e,p(n));return new nt(i,s=>Pr(r,s))}async function Io(t,e,n){let r=p(t);if(y(r.auth.app))return Promise.reject(A(r.auth));let i=await sn(r.auth,e,p(n));return new nt(i,s=>Rr(r,s))}async function sn(t,e,n){if(!t._getRecaptchaConfig())try{await As(t)}catch{console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let r;if(typeof e=="string"?r={phoneNumber:e}:r=e,"session"in r){let i=r.session;if("phoneNumber"in r){u(i.type==="enroll",t,"internal-error");let s={idToken:i.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"}};return(await oe(t,s,"mfaSmsEnrollment",async(o,d)=>{if(d.phoneEnrollmentInfo.captchaResponse===Ye){u(n?.type===Xe,o,"argument-error");let f=await Bn(o,d,n);return ji(o,f)}return ji(o,d)},"PHONE_PROVIDER").catch(o=>Promise.reject(o))).phoneSessionInfo.sessionInfo}else{u(i.type==="signin",t,"internal-error");let s=r.multiFactorHint?.uid||r.multiFactorUid;u(s,t,"missing-multi-factor-info");let a={mfaPendingCredential:i.credential,mfaEnrollmentId:s,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}};return(await oe(t,a,"mfaSmsSignIn",async(d,f)=>{if(f.phoneSignInInfo.captchaResponse===Ye){u(n?.type===Xe,d,"argument-error");let h=await Bn(d,f,n);return Ki(d,h)}return Ki(d,f)},"PHONE_PROVIDER").catch(d=>Promise.reject(d))).phoneResponseInfo.sessionInfo}}else{let i={phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"};return(await oe(t,i,"sendVerificationCode",async(l,o)=>{if(o.captchaResponse===Ye){u(n?.type===Xe,l,"argument-error");let d=await Bn(l,o,n);return zi(l,d)}return zi(l,o)},"PHONE_PROVIDER").catch(l=>Promise.reject(l))).sessionInfo}}finally{n?._reset()}}async function yo(t,e){let n=p(t);if(y(n.auth.app))return Promise.reject(A(n.auth));await kr(n,e)}async function Bn(t,e,n){u(n.type===Xe,t,"argument-error");let r=await n.verify();u(typeof r=="string",t,"argument-error");let i={...e};if("phoneEnrollmentInfo"in i){let s=i.phoneEnrollmentInfo.phoneNumber,a=i.phoneEnrollmentInfo.captchaResponse,c=i.phoneEnrollmentInfo.clientType,l=i.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(i,{phoneEnrollmentInfo:{phoneNumber:s,recaptchaToken:r,captchaResponse:a,clientType:c,recaptchaVersion:l}}),i}else if("phoneSignInInfo"in i){let s=i.phoneSignInInfo.captchaResponse,a=i.phoneSignInInfo.clientType,c=i.phoneSignInInfo.recaptchaVersion;return Object.assign(i,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:s,clientType:a,recaptchaVersion:c}}),i}else return Object.assign(i,{recaptchaToken:r}),i}function ye(t,e){return e?K(e):(u(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}function Ml(t){return Ms(t.auth,new rt(t),t.bypassAuthState)}function Ul(t){let{auth:e,user:n}=t;return u(n,e,"internal-error"),Ls(n,new rt(t),t.bypassAuthState)}async function Fl(t){let{auth:e,user:n}=t;return u(n,e,"internal-error"),kr(n,new rt(t),t.bypassAuthState)}async function bo(t,e,n){if(y(t.app))return Promise.reject(k(t,"operation-not-supported-in-this-environment"));let r=E(t);Ue(t,e,F);let i=ye(r,n);return new Me(r,"signInViaPopup",e,i).executeNotNull()}async function Eo(t,e,n){let r=p(t);if(y(r.auth.app))return Promise.reject(k(r.auth,"operation-not-supported-in-this-environment"));Ue(r.auth,e,F);let i=ye(r.auth,n);return new Me(r.auth,"reauthViaPopup",e,i,r).executeNotNull()}async function wo(t,e,n){let r=p(t);Ue(r.auth,e,F);let i=ye(r.auth,n);return new Me(r.auth,"linkViaPopup",e,i,r).executeNotNull()}async function Hl(t,e){let n=vo(e),r=To(t);if(!await r._isAvailable())return!1;let i=await r._get(n)==="true";return await r._remove(n),i}async function Fr(t,e){return To(t)._set(vo(e),"true")}function Wl(t,e){Tt.set(t._key(),e)}function To(t){return K(t._redirectPersistence)}function vo(t){return wt(Vl,t.config.apiKey,t.name)}function Ao(t,e,n){return Bl(t,e,n)}async function Bl(t,e,n){if(y(t.app))return Promise.reject(A(t));let r=E(t);Ue(t,e,F),await r._initializationPromise;let i=ye(r,n);return await Fr(i,r),i._openRedirect(r,e,"signInViaRedirect")}function So(t,e,n){return zl(t,e,n)}async function zl(t,e,n){let r=p(t);if(Ue(r.auth,e,F),y(r.auth.app))return Promise.reject(A(r.auth));await r.auth._initializationPromise;let i=ye(r.auth,n);await Fr(i,r.auth);let s=await Co(r);return i._openRedirect(r.auth,e,"reauthViaRedirect",s)}function ko(t,e,n){return $l(t,e,n)}async function $l(t,e,n){let r=p(t);Ue(r.auth,e,F),await r.auth._initializationPromise;let i=ye(r.auth,n);await Qt(!1,r,e.providerId),await Fr(i,r.auth);let s=await Co(r);return i._openRedirect(r.auth,e,"linkViaRedirect",s)}async function Po(t,e){return await E(t)._initializationPromise,Ro(t,e,!1)}async function Ro(t,e,n=!1){if(y(t.app))return Promise.reject(A(t));let r=E(t),i=ye(r,e),a=await new dr(r,i,n).execute();return a&&!n&&(delete a.user._redirectEventId,await r._persistUserIfCurrent(a.user),await r._setRedirectUser(null,e)),a}async function Co(t){let e=nn(`${t.uid}:::`);return t._redirectEventId=e,await t.auth._setRedirectUser(t),await t.auth._persistUserIfCurrent(t),e}function Ji(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function Oo({type:t,error:e}){return t==="unknown"&&e?.code==="auth/no-auth-event"}function Gl(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Oo(t);default:return!1}}async function ql(t,e={}){return _(t,"GET","/v1/projects",e)}async function Yl(t){if(t.config.emulator)return;let{authorizedDomains:e}=await ql(t);for(let n of e)try{if(Xl(n))return}catch{}R(t,"unauthorized-domain")}function Xl(t){let e=Ze(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){let a=new URL(t);return a.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&a.hostname===r}if(!Jl.test(n))return!1;if(Kl.test(t))return r===t;let i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}function Yi(){let t=w().___jsl;if(t?.H){for(let e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function Ql(t){return new Promise((e,n)=>{function r(){Yi(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Yi(),n(k(t,"network-request-failed"))},timeout:Zl.get()})}if(w().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else if(w().gapi?.load)r();else{let i=vs("iframefcb");return w()[i]=()=>{gapi.load?r():n(k(t,"network-request-failed"))},vr(`${Mc()}?onload=${i}`).catch(s=>n(s))}}).catch(e=>{throw vt=null,e})}function eu(t){return vt=vt||Ql(t),vt}function ou(t){let e=t.config;u(e.authDomain,t,"auth-domain-config-required");let n=e.emulator?br(e,ru):`https://${t.config.authDomain}/${nu}`,r={apiKey:e.apiKey,appName:t.name,v:fe},i=su.get(t.config.apiHost);i&&(r.eid=i);let s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${ue(r).slice(1)}`}async function au(t){let e=await eu(t),n=w().gapi;return u(n,t,"internal-error"),e.open({where:document.body,url:ou(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:iu,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});let a=k(t,"network-request-failed"),c=w().setTimeout(()=>{s(a)},tu.get());function l(){w().clearTimeout(c),i(r)}r.ping(l).then(l,()=>{s(a)})}))}function fu(t,e,n,r=lu,i=uu){let s=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString(),c="",l={...cu,width:r.toString(),height:i.toString(),top:s,left:a},o=S().toLowerCase();n&&(c=_s(o)?du:n),ms(o)&&(e=e||hu,l.scrollbars="yes");let d=Object.entries(l).reduce((h,[I,b])=>`${h}${I}=${b},`,"");if(Pc(o)&&c!=="_self")return pu(e||"",c),new Kt(null);let f=window.open(e||"",c,d);u(f,t,"popup-blocked");try{f.focus()}catch{}return new Kt(f)}function pu(t,e){let n=document.createElement("a");n.href=t,n.target=e;let r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}async function Xi(t,e,n,r,i,s){u(t.config.authDomain,t,"auth-domain-config-required"),u(t.config.apiKey,t,"invalid-api-key");let a={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:fe,eventId:i};if(e instanceof F){e.setDefaultLanguage(t.languageCode),a.providerId=e.providerId||"",ui(e.getCustomParameters())||(a.customParameters=JSON.stringify(e.getCustomParameters()));for(let[d,f]of Object.entries(s||{}))a[d]=f}if(e instanceof ce){let d=e.getScopes().filter(f=>f!=="");d.length>0&&(a.scopes=d.join(","))}t.tenantId&&(a.tid=t.tenantId);let c=a;for(let d of Object.keys(c))c[d]===void 0&&delete c[d];let l=await t._getAppCheckToken(),o=l?`#${_u}=${encodeURIComponent(l)}`:"";return`${Iu(t)}?${ue(c).slice(1)}${o}`}function Iu({config:t}){return t.emulator?br(t,gu):`https://${t.authDomain}/${mu}`}function bt(t){return typeof t>"u"||t?.length===0}function yu(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function bu(t){he(new H("auth",(e,{options:n})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:a,authDomain:c}=r.options;u(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});let l={apiKey:a,authDomain:c,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Ts(t)},o=new Kn(r,i,s,l);return Hc(o,n),o},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),he(new H("auth-internal",e=>{let n=E(e.getProvider("auth").getImmediate());return(r=>new mr(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),B(Zi,Qi,yu(t)),B(Zi,Qi,"esm2020")}function No(t=Un()){let e=$e(t,"auth");if(e.isInitialized())return e.getImmediate();let n=Ar(t,{popupRedirectResolver:xr,persistence:[Ur,Lr,tn]}),r=In("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){let s=new URL(r,location.origin);if(location.origin===s.origin){let a=Tu(s.toString());Dr(n,a,()=>a(n.currentUser)),Nr(n,c=>a(c))}}let i=ti("auth");return i&&Sr(n,`http://${i}`),n}function vu(){return document.getElementsByTagName("head")?.[0]??document}var ts,ns,rs,is,ss,as,gr,cs,ls,At,pe,St,_c,Ic,yc,$n,kt,jn,Qe,Je,se,Vi,Rt,Ct,Ot,Gn,Oc,qn,Kn,Nt,at,Uc,Fc,yt,Jn,Yn,Xn,Zn,Vc,Ye,Wi,tt,Z,Re,Qc,$,nl,me,ge,Q,F,ce,Dt,Ce,Oe,Ne,ol,Lt,al,Mt,De,x,Qn,_e,er,tr,ae,Ut,nr,rr,ir,sr,Ft,or,ar,xn,xt,Vt,gl,_l,Ht,Lr,Il,Wt,ho,Bt,tn,zt,cr,fo,vl,$t,po,Ie,kl,Pl,jt,Ur,Wn,Ol,lr,ur,Xe,Dl,Gt,nt,Le,rt,qt,xl,Me,Vl,Tt,dr,jl,hr,Kl,Jl,Zl,vt,tu,nu,ru,iu,su,cu,lu,uu,du,hu,Kt,mu,gu,_u,zn,fr,xr,Jt,pr,it,st,Yt,ot,Zi,Qi,mr,Eu,wu,es,Tu,Do=U(()=>{je();Ae();mt();pt();ts={PHONE:"phone",TOTP:"totp"},ns={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},rs={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},is={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},ss={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"};as=fc,gr=os,cs=new G("auth","Firebase",os()),ls={ADMIN_ONLY_OPERATION:"auth/admin-restricted-operation",ARGUMENT_ERROR:"auth/argument-error",APP_NOT_AUTHORIZED:"auth/app-not-authorized",APP_NOT_INSTALLED:"auth/app-not-installed",CAPTCHA_CHECK_FAILED:"auth/captcha-check-failed",CODE_EXPIRED:"auth/code-expired",CORDOVA_NOT_READY:"auth/cordova-not-ready",CORS_UNSUPPORTED:"auth/cors-unsupported",CREDENTIAL_ALREADY_IN_USE:"auth/credential-already-in-use",CREDENTIAL_MISMATCH:"auth/custom-token-mismatch",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"auth/requires-recent-login",DEPENDENT_SDK_INIT_BEFORE_AUTH:"auth/dependent-sdk-initialized-before-auth",DYNAMIC_LINK_NOT_ACTIVATED:"auth/dynamic-link-not-activated",EMAIL_CHANGE_NEEDS_VERIFICATION:"auth/email-change-needs-verification",EMAIL_EXISTS:"auth/email-already-in-use",EMULATOR_CONFIG_FAILED:"auth/emulator-config-failed",EXPIRED_OOB_CODE:"auth/expired-action-code",EXPIRED_POPUP_REQUEST:"auth/cancelled-popup-request",INTERNAL_ERROR:"auth/internal-error",INVALID_API_KEY:"auth/invalid-api-key",INVALID_APP_CREDENTIAL:"auth/invalid-app-credential",INVALID_APP_ID:"auth/invalid-app-id",INVALID_AUTH:"auth/invalid-user-token",INVALID_AUTH_EVENT:"auth/invalid-auth-event",INVALID_CERT_HASH:"auth/invalid-cert-hash",INVALID_CODE:"auth/invalid-verification-code",INVALID_CONTINUE_URI:"auth/invalid-continue-uri",INVALID_CORDOVA_CONFIGURATION:"auth/invalid-cordova-configuration",INVALID_CUSTOM_TOKEN:"auth/invalid-custom-token",INVALID_DYNAMIC_LINK_DOMAIN:"auth/invalid-dynamic-link-domain",INVALID_EMAIL:"auth/invalid-email",INVALID_EMULATOR_SCHEME:"auth/invalid-emulator-scheme",INVALID_IDP_RESPONSE:"auth/invalid-credential",INVALID_LOGIN_CREDENTIALS:"auth/invalid-credential",INVALID_MESSAGE_PAYLOAD:"auth/invalid-message-payload",INVALID_MFA_SESSION:"auth/invalid-multi-factor-session",INVALID_OAUTH_CLIENT_ID:"auth/invalid-oauth-client-id",INVALID_OAUTH_PROVIDER:"auth/invalid-oauth-provider",INVALID_OOB_CODE:"auth/invalid-action-code",INVALID_ORIGIN:"auth/unauthorized-domain",INVALID_PASSWORD:"auth/wrong-password",INVALID_PERSISTENCE:"auth/invalid-persistence-type",INVALID_PHONE_NUMBER:"auth/invalid-phone-number",INVALID_PROVIDER_ID:"auth/invalid-provider-id",INVALID_RECIPIENT_EMAIL:"auth/invalid-recipient-email",INVALID_SENDER:"auth/invalid-sender",INVALID_SESSION_INFO:"auth/invalid-verification-id",INVALID_TENANT_ID:"auth/invalid-tenant-id",MFA_INFO_NOT_FOUND:"auth/multi-factor-info-not-found",MFA_REQUIRED:"auth/multi-factor-auth-required",MISSING_ANDROID_PACKAGE_NAME:"auth/missing-android-pkg-name",MISSING_APP_CREDENTIAL:"auth/missing-app-credential",MISSING_AUTH_DOMAIN:"auth/auth-domain-config-required",MISSING_CODE:"auth/missing-verification-code",MISSING_CONTINUE_URI:"auth/missing-continue-uri",MISSING_IFRAME_START:"auth/missing-iframe-start",MISSING_IOS_BUNDLE_ID:"auth/missing-ios-bundle-id",MISSING_OR_INVALID_NONCE:"auth/missing-or-invalid-nonce",MISSING_MFA_INFO:"auth/missing-multi-factor-info",MISSING_MFA_SESSION:"auth/missing-multi-factor-session",MISSING_PHONE_NUMBER:"auth/missing-phone-number",MISSING_PASSWORD:"auth/missing-password",MISSING_SESSION_INFO:"auth/missing-verification-id",MODULE_DESTROYED:"auth/app-deleted",NEED_CONFIRMATION:"auth/account-exists-with-different-credential",NETWORK_REQUEST_FAILED:"auth/network-request-failed",NULL_USER:"auth/null-user",NO_AUTH_EVENT:"auth/no-auth-event",NO_SUCH_PROVIDER:"auth/no-such-provider",OPERATION_NOT_ALLOWED:"auth/operation-not-allowed",OPERATION_NOT_SUPPORTED:"auth/operation-not-supported-in-this-environment",POPUP_BLOCKED:"auth/popup-blocked",POPUP_CLOSED_BY_USER:"auth/popup-closed-by-user",PROVIDER_ALREADY_LINKED:"auth/provider-already-linked",QUOTA_EXCEEDED:"auth/quota-exceeded",REDIRECT_CANCELLED_BY_USER:"auth/redirect-cancelled-by-user",REDIRECT_OPERATION_PENDING:"auth/redirect-operation-pending",REJECTED_CREDENTIAL:"auth/rejected-credential",SECOND_FACTOR_ALREADY_ENROLLED:"auth/second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"auth/maximum-second-factor-count-exceeded",TENANT_ID_MISMATCH:"auth/tenant-id-mismatch",TIMEOUT:"auth/timeout",TOKEN_EXPIRED:"auth/user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"auth/too-many-requests",UNAUTHORIZED_DOMAIN:"auth/unauthorized-continue-uri",UNSUPPORTED_FIRST_FACTOR:"auth/unsupported-first-factor",UNSUPPORTED_PERSISTENCE:"auth/unsupported-persistence-type",UNSUPPORTED_TENANT_OPERATION:"auth/unsupported-tenant-operation",UNVERIFIED_EMAIL:"auth/unverified-email",USER_CANCELLED:"auth/user-cancelled",USER_DELETED:"auth/user-not-found",USER_DISABLED:"auth/user-disabled",USER_MISMATCH:"auth/user-mismatch",USER_SIGNED_OUT:"auth/user-signed-out",WEAK_PASSWORD:"auth/weak-password",WEB_STORAGE_UNSUPPORTED:"auth/web-storage-unsupported",ALREADY_INITIALIZED:"auth/already-initialized",RECAPTCHA_NOT_ENABLED:"auth/recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"auth/missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"auth/invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"auth/invalid-recaptcha-action",MISSING_CLIENT_TYPE:"auth/missing-client-type",MISSING_RECAPTCHA_VERSION:"auth/missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"auth/invalid-recaptcha-version",INVALID_REQ_TYPE:"auth/invalid-req-type",INVALID_HOSTING_LINK_DOMAIN:"auth/invalid-hosting-link-domain"};At=new Se("@firebase/auth");pe=class{constructor(e,n){this.shortDelay=e,this.longDelay=n,Y(n>e,"Short delay should be less than long delay!"),this.isMobile=ni()||oi()}get(){return mc()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};St=class{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;z("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;z("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;z("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};_c={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_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"};Ic=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],yc=new pe(3e4,6e4);$n=class{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(k(this.auth,"network-request-failed")),yc.get())})}};kt=class{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(let n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return bc(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}};jn=class{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,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){let n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;let r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;let n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}};Qe=class{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ke(this.lastLoginAt),this.creationTime=Ke(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};Je=class t{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");let n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):xi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){u(e.length!==0,"internal-error");let n=xi(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(u(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){let{accessToken:r,refreshToken:i,expiresIn:s}=await Sc(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){let{refreshToken:r,accessToken:i,expirationTime:s}=n,a=new t;return r&&(u(typeof r=="string","internal-error",{appName:e}),a.refreshToken=r),i&&(u(typeof i=="string","internal-error",{appName:e}),a.accessToken=i),s&&(u(typeof s=="number","internal-error",{appName:e}),a.expirationTime=s),a}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 z("not implemented")}};se=class t{constructor({uid:e,auth:n,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new jn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new Qe(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){let n=await X(this,this.stsTokenManager.getToken(this.auth,e));return u(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return Er(this,e)}reload(){return wr(this)}_assign(e){this!==e&&(u(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(n=>({...n})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let n=new t({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(e){u(!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,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await et(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(y(this.auth.app))return Promise.reject(A(this.auth));let e=await this.getIdToken();return await X(this,wc(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,isAnonymous: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,n){let r=n.displayName??void 0,i=n.email??void 0,s=n.phoneNumber??void 0,a=n.photoURL??void 0,c=n.tenantId??void 0,l=n._redirectEventId??void 0,o=n.createdAt??void 0,d=n.lastLoginAt??void 0,{uid:f,emailVerified:h,isAnonymous:I,providerData:b,stsTokenManager:C}=n;u(f&&C,e,"internal-error");let V=Je.fromJSON(this.name,C);u(typeof f=="string",e,"internal-error"),ie(r,e.name),ie(i,e.name),u(typeof h=="boolean",e,"internal-error"),u(typeof I=="boolean",e,"internal-error"),ie(s,e.name),ie(a,e.name),ie(c,e.name),ie(l,e.name),ie(o,e.name),ie(d,e.name);let P=new t({uid:f,auth:e,email:i,emailVerified:h,displayName:r,isAnonymous:I,photoURL:a,phoneNumber:s,tenantId:c,stsTokenManager:V,createdAt:o,lastLoginAt:d});return b&&Array.isArray(b)&&(P.providerData=b.map(O=>({...O}))),l&&(P._redirectEventId=l),P}static async _fromIdTokenResponse(e,n,r=!1){let i=new Je;i.updateFromServerResponse(n);let s=new t({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await et(s),s}static async _fromGetAccountInfoResponse(e,n,r){let i=n.users[0];u(i.localId!==void 0,"internal-error");let s=i.providerUserInfo!==void 0?ps(i.providerUserInfo):[],a=!(i.email&&i.passwordHash)&&!s?.length,c=new Je;c.updateFromIdToken(r);let l=new t({uid:i.localId,auth:e,stsTokenManager:c,isAnonymous:a}),o={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new Qe(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!s?.length};return Object.assign(l,o),l}};Vi=new Map;Rt=class{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){let n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}};Rt.type="NONE";Ct=Rt;Ot=class t{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;let{config:i,name:s}=this.auth;this.fullUserKey=wt(this.userKey,i.apiKey,s),this.fullPersistenceKey=wt("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),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(typeof e=="string"){let n=await Pt(this.auth,{idToken:e}).catch(()=>{});return n?se._fromGetAccountInfoResponse(this.auth,n,e):null}return se._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 n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new t(K(Ct),e,r);let i=(await Promise.all(n.map(async o=>{if(await o._isAvailable())return o}))).filter(o=>o),s=i[0]||K(Ct),a=wt(r,e.config.apiKey,e.name),c=null;for(let o of n)try{let d=await o._get(a);if(d){let f;if(typeof d=="string"){let h=await Pt(e,{idToken:d}).catch(()=>{});if(!h)break;f=await se._fromGetAccountInfoResponse(e,h,d)}else f=se._fromJSON(e,d);o!==s&&(c=f),s=o;break}}catch{}let l=i.filter(o=>o._shouldAllowMigration);return!s._shouldAllowMigration||!l.length?new t(s,e,r):(s=l[0],c&&await s._set(a,c.toJSON()),await Promise.all(n.map(async o=>{if(o!==s)try{await o._remove(a)}catch{}})),new t(s,e,r))}};Gn=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){let r=s=>new Promise((a,c)=>{try{let l=e(s);a(l)}catch(l){c(l)}});r.onAbort=n,this.queue.push(r);let i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let n=[];try{for(let r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(let i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}};Oc=6,qn=class{constructor(e){let n=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??Oc,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){let n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,n),this.validatePasswordCharacterOptions(e,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(e,n){let r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}};Kn=class{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Nt(this),this.idTokenSubscription=new Nt(this),this.beforeStateQueue=new Gn(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=cs,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=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=K(n)),this._initializationPromise=this.queue(async()=>{if(!this._deleted&&(this.persistenceManager=await Ot.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),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 n=await Pt(this,{idToken:e}),r=await se._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(y(this.app)){let s=this.app.settings.authIdToken;return s?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(a,a))}):this.directlySetCurrentUser(null)}let n=await this.assertedPersistence.getCurrentUser(),r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let s=this.redirectUser?._redirectEventId,a=r?._redirectEventId,c=await this.tryRedirectSignIn(e);(!s||s===a)&&c?.user&&(r=c.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(s){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return u(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 n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await et(e)}catch(n){if(n?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=gc()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(y(this.app))return Promise.reject(A(this));let n=e?p(e):null;return n&&u(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&u(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return y(this.app)?Promise.reject(A(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return y(this.app)?Promise.reject(A(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(K(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=await Cc(this),n=new qn(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new G("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){let n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await kc(this,r)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,n){let r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let n=e&&K(e)||this._popupRedirectResolver;u(n,this,"argument-error"),this.redirectPersistenceManager=await Ot.create(this,[K(n._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,n,r,i){if(this._deleted)return()=>{};let s=typeof n=="function"?n:n.next.bind(n),a=!1,c=this._isInitialized?Promise.resolve():this._initializationPromise;if(u(c,this,"internal-error"),c.then(()=>{a||s(this.currentUser)}),typeof n=="function"){let l=e.addObserver(n,r,i);return()=>{a=!0,l()}}else{let l=e.addObserver(n);return()=>{a=!0,l()}}}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 u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Ts(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 n=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();n&&(e["X-Firebase-Client"]=n);let r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(y(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&pc(`Error while retrieving App Check token: ${e.error}`),e?.token}};Nt=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=di(n=>this.observer=n)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};at={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};Uc=500,Fc=6e4,yt=1e12,Jn=class{constructor(e){this.auth=e,this.counter=yt,this._widgets=new Map}render(e,n){let r=this.counter;return this._widgets.set(r,new Zn(e,this.auth.name,n||{})),this.counter++,r}reset(e){let n=e||yt;this._widgets.get(n)?.delete(),this._widgets.delete(n)}getResponse(e){let n=e||yt;return this._widgets.get(n)?.getResponse()||""}async execute(e){let n=e||yt;return this._widgets.get(n)?.execute(),""}},Yn=class{constructor(){this.enterprise=new Xn}ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}},Xn=class{ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}},Zn=class{constructor(e,n,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};let i=typeof e=="string"?document.getElementById(e):e;u(i,"argument-error",{appName:n}),this.container=i,this.isVisible=this.params.size!=="invisible",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=xc(50);let{callback:e,"expired-callback":n}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,n)try{n()}catch{}this.isVisible&&this.execute()},Fc)},Uc))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}};Vc="recaptcha-enterprise",Ye="NO_RECAPTCHA",Wi="onFirebaseAuthREInstanceReady",tt=class t{constructor(e){this.type=Vc,this.auth=E(e)}async verify(e="verify",n=!1){async function r(s){if(!n){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(a,c)=>{hs(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)c(new Error("recaptcha Enterprise site key undefined"));else{let o=new kt(l);return s.tenantId==null?s._agentRecaptchaConfig=o:s._tenantRecaptchaConfigs[s.tenantId]=o,a(o.siteKey)}}).catch(l=>{c(l)})})}function i(s,a,c){let l=window.grecaptcha;Fi(l)?l.enterprise.ready(()=>{l.enterprise.execute(s,{action:e}).then(o=>{a(o)}).catch(()=>{a(Ye)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new Yn().execute("siteKey",{action:"verify"}):new Promise((s,a)=>{r(this.auth).then(async c=>{if(!n&&Fi(window.grecaptcha)&&t.scriptInjectionDeferred)await t.scriptInjectionDeferred.promise,i(c,s,a);else{if(typeof window>"u"){a(new Error("RecaptchaVerifier is only supported in browser"));return}let l=Lc();l.length!==0&&(l+=c+`&onload=${Wi}`),t.scriptInjectionDeferred=new we,window[Wi]=()=>{t.scriptInjectionDeferred?.resolve()},vr(l).then(()=>t.scriptInjectionDeferred?.promise).then(()=>{i(c,s,a)}).catch(o=>{a(o)})}}).catch(c=>{a(c)})})}};tt.scriptInjectionDeferred=null;Z=class{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return z("not implemented")}_getIdTokenResponse(e){return z("not implemented")}_linkToIdToken(e,n){return z("not implemented")}_getReauthenticationResolver(e){return z("not implemented")}};Re=class t extends Z{constructor(e,n,r,i=null){super("password",r),this._email=e,this._password=n,this._tenantId=i}static _fromEmailAndPassword(e,n){return new t(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new t(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let n=typeof e=="string"?JSON.parse(e):e;if(n?.email&&n?.password){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":let n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return oe(e,n,"signInWithPassword",Gc,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return Xc(e,{email:this._email,oobCode:this._password});default:R(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":let r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return oe(e,r,"signUpPassword",$c,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return Zc(e,{idToken:n,email:this._email,oobCode:this._password});default:R(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}};Qc="http://localhost",$=class t extends Z{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let n=new t(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):R("argument-error"),n}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 n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=n;if(!r||!i)return null;let a=new t(r,i);return a.idToken=s.idToken||void 0,a.accessToken=s.accessToken||void 0,a.secret=s.secret,a.nonce=s.nonce,a.pendingToken=s.pendingToken||null,a}_getIdTokenResponse(e){let n=this.buildRequest();return J(e,n)}_linkToIdToken(e,n){let r=this.buildRequest();return r.idToken=n,J(e,r)}_getReauthenticationResolver(e){let n=this.buildRequest();return n.autoCreate=!1,J(e,n)}buildRequest(){let e={requestUri:Qc,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=ue(n)}return e}};nl={USER_NOT_FOUND:"user-not-found"};me=class t extends Z{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,n){return new t({verificationId:e,verificationCode:n})}static _fromTokenResponse(e,n){return new t({phoneNumber:e,temporaryProof:n})}_getIdTokenResponse(e){return el(e,this._makeVerificationRequest())}_linkToIdToken(e,n){return tl(e,{idToken:n,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return rl(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:n,verificationId:r,verificationCode:i}=this.params;return e&&n?{temporaryProof:e,phoneNumber:n}:{sessionInfo:r,code:i}}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){typeof e=="string"&&(e=JSON.parse(e));let{verificationId:n,verificationCode:r,phoneNumber:i,temporaryProof:s}=e;return!r&&!n&&!i&&!s?null:new t({verificationId:n,verificationCode:r,phoneNumber:i,temporaryProof:s})}};ge=class t{constructor(e){let n=Te(ve(e)),r=n.apiKey??null,i=n.oobCode??null,s=il(n.mode??null);u(r&&i&&s,"argument-error"),this.apiKey=r,this.operation=s,this.code=i,this.continueUrl=n.continueUrl??null,this.languageCode=n.lang??null,this.tenantId=n.tenantId??null}static parseLink(e){let n=sl(e);try{return new t(n)}catch{return null}}};Q=class t{constructor(){this.providerId=t.PROVIDER_ID}static credential(e,n){return Re._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){let r=ge.parseLink(n);return u(r,"argument-error"),Re._fromEmailAndCode(e,r.code,r.tenantId)}};Q.PROVIDER_ID="password";Q.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Q.EMAIL_LINK_SIGN_IN_METHOD="emailLink";F=class{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}};ce=class extends F{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}},Dt=class t extends ce{static credentialFromJSON(e){let n=typeof e=="string"?JSON.parse(e):e;return u("providerId"in n&&"signInMethod"in n,"argument-error"),$._fromParams(n)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return u(e.idToken||e.accessToken,"argument-error"),$._fromParams({...e,providerId:this.providerId,signInMethod:this.providerId})}static credentialFromResult(e){return t.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return t.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:n,oauthAccessToken:r,oauthTokenSecret:i,pendingToken:s,nonce:a,providerId:c}=e;if(!r&&!i&&!n&&!s||!c)return null;try{return new t(c)._credential({idToken:n,accessToken:r,nonce:a,pendingToken:s})}catch{return null}}};Ce=class t extends ce{constructor(){super("facebook.com")}static credential(e){return $._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return t.credentialFromTaggedObject(e)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return t.credential(e.oauthAccessToken)}catch{return null}}};Ce.FACEBOOK_SIGN_IN_METHOD="facebook.com";Ce.PROVIDER_ID="facebook.com";Oe=class t extends ce{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return $._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return t.credentialFromTaggedObject(e)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return t.credential(n,r)}catch{return null}}};Oe.GOOGLE_SIGN_IN_METHOD="google.com";Oe.PROVIDER_ID="google.com";Ne=class t extends ce{constructor(){super("github.com")}static credential(e){return $._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return t.credentialFromTaggedObject(e)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return t.credential(e.oauthAccessToken)}catch{return null}}};Ne.GITHUB_SIGN_IN_METHOD="github.com";Ne.PROVIDER_ID="github.com";ol="http://localhost",Lt=class t extends Z{constructor(e,n){super(e,e),this.pendingToken=n}_getIdTokenResponse(e){let n=this.buildRequest();return J(e,n)}_linkToIdToken(e,n){let r=this.buildRequest();return r.idToken=n,J(e,r)}_getReauthenticationResolver(e){let n=this.buildRequest();return n.autoCreate=!1,J(e,n)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,pendingToken:s}=n;return!r||!i||!s||r!==i?null:new t(r,s)}static _create(e,n){return new t(e,n)}buildRequest(){return{requestUri:ol,returnSecureToken:!0,pendingToken:this.pendingToken}}};al="saml.",Mt=class t extends F{constructor(e){u(e.startsWith(al),"argument-error"),super(e)}static credentialFromResult(e){return t.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return t.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let n=Lt.fromJSON(e);return u(n,"argument-error"),n}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:n,providerId:r}=e;if(!n||!r)return null;try{return Lt._create(r,n)}catch{return null}}};De=class t extends ce{constructor(){super("twitter.com")}static credential(e,n){return $._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return t.credentialFromTaggedObject(e)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return t.credential(n,r)}catch{return null}}};De.TWITTER_SIGN_IN_METHOD="twitter.com";De.PROVIDER_ID="twitter.com";x=class t{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){let s=await se._fromIdTokenResponse(e,r,i),a=$i(r);return new t({user:s,providerId:a,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);let i=$i(r);return new t({user:e,providerId:i,_tokenResponse:r,operationType:n})}};Qn=class t extends L{constructor(e,n,r,i){super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,t.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new t(e,n,r,i)}};_e=class{constructor(e,n){this.factorId=e,this.uid=n.mfaEnrollmentId,this.enrollmentTime=new Date(n.enrolledAt).toUTCString(),this.displayName=n.displayName}static _fromServerResponse(e,n){return"phoneInfo"in n?er._fromServerResponse(e,n):"totpInfo"in n?tr._fromServerResponse(e,n):R(e,"internal-error")}},er=class t extends _e{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,n){return new t(n)}},tr=class t extends _e{constructor(e){super("totp",e)}static _fromServerResponse(e,n){return new t(n)}};ae=class{constructor(e,n,r={}){this.isNewUser=e,this.providerId=n,this.profile=r}},Ut=class extends ae{constructor(e,n,r,i){super(e,n,r),this.username=i}},nr=class extends ae{constructor(e,n){super(e,"facebook.com",n)}},rr=class extends Ut{constructor(e,n){super(e,"github.com",n,typeof n?.login=="string"?n?.login:null)}},ir=class extends ae{constructor(e,n){super(e,"google.com",n)}},sr=class extends Ut{constructor(e,n,r){super(e,"twitter.com",n,r)}};Ft=class t{constructor(e,n,r){this.type=e,this.credential=n,this.user=r}static _fromIdtoken(e,n){return new t("enroll",e,n)}static _fromMfaPendingCredential(e){return new t("signin",e)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){if(e?.multiFactorSession){if(e.multiFactorSession?.pendingCredential)return t._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(e.multiFactorSession?.idToken)return t._fromIdtoken(e.multiFactorSession.idToken)}return null}};or=class t{constructor(e,n,r){this.session=e,this.hints=n,this.signInResolver=r}static _fromError(e,n){let r=E(e),i=n.customData._serverResponse,s=(i.mfaInfo||[]).map(c=>_e._fromServerResponse(r,c));u(i.mfaPendingCredential,r,"internal-error");let a=Ft._fromMfaPendingCredential(i.mfaPendingCredential);return new t(a,s,async c=>{let l=await c._process(r,a);delete i.mfaInfo,delete i.mfaPendingCredential;let o={...i,idToken:l.idToken,refreshToken:l.refreshToken};switch(n.operationType){case"signIn":let d=await x._fromIdTokenResponse(r,n.operationType,o);return await r._updateCurrentUser(d.user),d;case"reauthenticate":return u(n.user,r,"internal-error"),x._forOperation(n.user,n.operationType,o);default:R(r,"internal-error")}})}async resolveSignIn(e){let n=e;return this.signInResolver(n)}};ar=class t{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(n=>{n.mfaInfo&&(this.enrolledFactors=n.mfaInfo.map(r=>_e._fromServerResponse(e.auth,r)))})}static _fromUser(e){return new t(e)}async getSession(){return Ft._fromIdtoken(await this.user.getIdToken(),this.user)}async enroll(e,n){let r=e,i=await this.getSession(),s=await X(this.user,r._process(this.user.auth,i,n));return await this.user._updateTokensIfNecessary(s),this.user.reload()}async unenroll(e){let n=typeof e=="string"?e:e.uid,r=await this.user.getIdToken();try{let i=await X(this.user,ml(this.user.auth,{idToken:r,mfaEnrollmentId:n}));this.enrolledFactors=this.enrolledFactors.filter(({uid:s})=>s!==n),await this.user._updateTokensIfNecessary(i),await this.user.reload()}catch(i){throw i}}},xn=new WeakMap;xt="__sak";Vt=class{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(xt,"1"),this.storage.removeItem(xt),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){let n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}};gl=1e3,_l=10,Ht=class extends Vt{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=ws(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let n of Object.keys(this.listeners)){let r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((a,c,l)=>{this.notifyListeners(a,l)});return}let r=e.key;n?this.detachListener():this.stopPolling();let i=()=>{let a=this.storage.getItem(r);!n&&this.localCache[r]===a||this.notifyListeners(r,a)},s=this.storage.getItem(r);Rc()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,_l):i()}notifyListeners(e,n){this.localCache[e]=n;let r=this.listeners[e];if(r)for(let i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},gl)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(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(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){let n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}};Ht.type="LOCAL";Lr=Ht;Il=1e3;Wt=class{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){if(typeof window===void 0)return e;let n=new URL(`${window.location.origin}/__cookies__`);return n.searchParams.set("finalTarget",e),n}async _isAvailable(){return typeof isSecureContext=="boolean"&&!isSecureContext||typeof navigator>"u"||typeof document>"u"?!1:navigator.cookieEnabled??!0}async _set(e,n){}async _get(e){if(!this._isAvailable())return null;let n=Hn(e);return window.cookieStore?(await window.cookieStore.get(n))?.value:Vn(n)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;let r=Hn(e);document.cookie=`${r}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch("/__cookies__",{method:"DELETE"}).catch(()=>{})}_addListener(e,n){if(!this._isAvailable())return;let r=Hn(e);if(window.cookieStore){let c=(o=>{let d=o.changed.find(h=>h.name===r);d&&n(d.value),o.deleted.find(h=>h.name===r)&&n(null)}),l=()=>window.cookieStore.removeEventListener("change",c);return this.listenerUnsubscribes.set(n,l),window.cookieStore.addEventListener("change",c)}let i=Vn(r),s=setInterval(()=>{let c=Vn(r);c!==i&&(n(c),i=c)},Il),a=()=>clearInterval(s);this.listenerUnsubscribes.set(n,a)}_removeListener(e,n){let r=this.listenerUnsubscribes.get(n);r&&(r(),this.listenerUnsubscribes.delete(n))}};Wt.type="COOKIE";ho=Wt;Bt=class extends Vt{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}};Bt.type="SESSION";tn=Bt;zt=class t{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;let r=new t(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let n=e,{eventId:r,eventType:i,data:s}=n.data,a=this.handlersMap[i];if(!a?.size)return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});let c=Array.from(a).map(async o=>o(n.origin,s)),l=await yl(c);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:l})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}};zt.receivers=[];cr=class{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,n,r=50){let i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,a;return new Promise((c,l)=>{let o=nn("",20);i.port1.start();let d=setTimeout(()=>{l(new Error("unsupported_event"))},r);a={messageChannel:i,onMessage(f){let h=f;if(h.data.eventId===o)switch(h.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),c(h.data.response);break;default:clearTimeout(d),clearTimeout(s),l(new Error("invalid_response"));break}}},this.handlers.add(a),i.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:o,data:n},[i.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}};fo="firebaseLocalStorageDb",vl=1,$t="firebaseLocalStorage",po="fbase_key",Ie=class{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}};kl=800,Pl=3,jt=class{constructor(){this.type="LOCAL",this.dbPromise=null,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.dbPromise?this.dbPromise:(this.dbPromise=mo(),this.dbPromise.catch(()=>{this.dbPromise=null}),this.dbPromise)}async _withRetries(e){let n=0;for(;;)try{let r=await this._openDb();return await e(r)}catch(r){if(n++>Pl)throw r;this.dbPromise&&((await this.dbPromise).close(),this.dbPromise=null)}}async initializeServiceWorkerMessaging(){return Mr()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=zt._getInstance(Tl()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await El(),!this.activeServiceWorker)return;this.sender=new cr(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||wl()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return indexedDB?(await this._withRetries(async e=>{await Gi(e,xt,"1"),await qi(e,xt)}),!0):!1}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>Gi(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){let n=await this._withRetries(r=>Sl(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>qi(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(i=>{let s=rn(i,!1).getAll();return new Ie(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];let n=[],r=new Set;if(e.length!==0)for(let{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(let i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;let r=this.listeners[e];if(r)for(let i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),kl)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}};jt.type="LOCAL";Ur=jt;Wn=vs("rcb"),Ol=new pe(3e4,6e4),lr=class{constructor(){this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!w().grecaptcha?.render}load(e,n=""){return u(Nl(n),e,"argument-error"),this.shouldResolveImmediately(n)&&Ui(w().grecaptcha)?Promise.resolve(w().grecaptcha):new Promise((r,i)=>{let s=w().setTimeout(()=>{i(k(e,"network-request-failed"))},Ol.get());w()[Wn]=()=>{w().clearTimeout(s),delete w()[Wn];let c=w().grecaptcha;if(!c||!Ui(c)){i(k(e,"internal-error"));return}let l=c.render;c.render=(o,d)=>{let f=l(o,d);return this.counter++,f},this.hostLanguage=n,r(c)};let a=`${Dc()}?${ue({onload:Wn,render:"explicit",hl:n})}`;vr(a).catch(()=>{clearTimeout(s),i(k(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!w().grecaptcha?.render&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}};ur=class{async load(e){return new Jn(e)}clearedOneInstance(){}};Xe="recaptcha",Dl={theme:"light",type:"image"},Gt=class{constructor(e,n,r={...Dl}){this.parameters=r,this.type=Xe,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=E(e),this.isInvisible=this.parameters.size==="invisible",u(typeof document<"u",this.auth,"operation-not-supported-in-this-environment");let i=typeof n=="string"?document.getElementById(n):n;u(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new ur:new lr,this.validateStartingState()}async verify(){this.assertNotDestroyed();let e=await this.render(),n=this.getAssertedRecaptcha(),r=n.getResponse(e);return r||new Promise(i=>{let s=a=>{a&&(this.tokenChangeListeners.delete(s),i(a))};this.tokenChangeListeners.add(s),this.isInvisible&&n.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise?this.renderPromise:(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e}),this.renderPromise)}_reset(){this.assertNotDestroyed(),this.widgetId!==null&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){u(!this.parameters.sitekey,this.auth,"argument-error"),u(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),u(typeof document<"u",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return n=>{if(this.tokenChangeListeners.forEach(r=>r(n)),typeof e=="function")e(n);else if(typeof e=="string"){let r=w()[e];typeof r=="function"&&r(n)}}}assertNotDestroyed(){u(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let n=document.createElement("div");e.appendChild(n),e=n}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){u(yr()&&!Mr(),this.auth,"internal-error"),await Ll(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let e=await Ec(this.auth);u(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return u(this.recaptcha,this.auth,"internal-error"),this.recaptcha}};nt=class{constructor(e,n){this.verificationId=e,this.onConfirmation=n}confirm(e){let n=me._fromVerification(this.verificationId,e);return this.onConfirmation(n)}};Le=class t{constructor(e){this.providerId=t.PROVIDER_ID,this.auth=E(e)}verifyPhoneNumber(e,n){return sn(this.auth,e,p(n))}static credential(e,n){return me._fromVerification(e,n)}static credentialFromResult(e){let n=e;return t.credentialFromTaggedObject(n)}static credentialFromError(e){return t.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:n,temporaryProof:r}=e;return n&&r?me._fromTokenResponse(n,r):null}};Le.PROVIDER_ID="phone";Le.PHONE_SIGN_IN_METHOD="phone";rt=class extends Z{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return J(e,this._buildIdpRequest())}_linkToIdToken(e,n){return J(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return J(e,this._buildIdpRequest())}_buildIdpRequest(e){let n={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&&(n.idToken=e),n}};qt=class{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){let{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:a,type:c}=e;if(a){this.reject(a);return}let l={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(c)(l))}catch(o){this.reject(o)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Ml;case"linkViaPopup":case"linkViaRedirect":return Fl;case"reauthViaPopup":case"reauthViaRedirect":return Ul;default:R(this.auth,"internal-error")}}resolve(e){Y(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Y(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}};xl=new pe(2e3,1e4);Me=class t extends qt{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,t.currentPopupAction&&t.currentPopupAction.cancel(),t.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return u(e,this.auth,"internal-error"),e}async onExecution(){Y(this.filter.length===1,"Popup operations only handle one event");let e=nn();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(k(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(k(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,t.currentPopupAction=null}pollUserCancellation(){let e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(k(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,xl.get())};e()}};Me.currentPopupAction=null;Vl="pendingRedirect",Tt=new Map,dr=class extends qt{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Tt.get(this.auth._key());if(!e){try{let r=await Hl(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Tt.set(this.auth._key(),e)}return this.bypassAuthState||Tt.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){let n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}};jl=600*1e3,hr=class{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 n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Gl(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){if(e.error&&!Oo(e)){let r=e.error.code?.split("auth/")[1]||"internal-error";n.onError(k(this.auth,r))}else n.onAuthEvent(e)}isEventForConsumer(e,n){let r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=jl&&this.cachedEventUids.clear(),this.cachedEventUids.has(Ji(e))}saveEventToCache(e){this.cachedEventUids.add(Ji(e)),this.lastProcessedEventTime=Date.now()}};Kl=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Jl=/^https?/;Zl=new pe(3e4,6e4);vt=null;tu=new pe(5e3,15e3),nu="__/auth/iframe",ru="emulator/auth/iframe",iu={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},su=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);cu={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},lu=500,uu=600,du="_blank",hu="http://localhost",Kt=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};mu="__/auth/handler",gu="emulator/auth/handler",_u=encodeURIComponent("fac");zn="webStorageSupport",fr=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=tn,this._completeRedirectFn=Ro,this._overrideRedirectResult=Wl}async _openPopup(e,n,r,i){Y(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");let s=await Xi(e,n,r,Ze(),i);return fu(e,s,nn())}async _openRedirect(e,n,r,i){await this._originValidation(e);let s=await Xi(e,n,r,Ze(),i);return bl(s),new Promise(()=>{})}_initialize(e){let n=e._key();if(this.eventManagers[n]){let{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(Y(s,"If manager is not set, promise should be"),s)}let r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){let n=await au(e),r=new hr(e);return n.register("authEvent",i=>(u(i?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(zn,{type:zn},i=>{let s=i?.[0]?.[zn];s!==void 0&&n(!!s),R(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=Yl(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return ws()||gs()||Tr()}},xr=fr,Jt=class{constructor(e){this.factorId=e}_process(e,n,r){switch(n.type){case"enroll":return this._finalizeEnroll(e,n.credential,r);case"signin":return this._finalizeSignIn(e,n.credential);default:return z("unexpected MultiFactorSessionType")}}},pr=class t extends Jt{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new t(e)}_finalizeEnroll(e,n,r){return hl(e,{idToken:n,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,n){return Rl(e,{mfaPendingCredential:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},it=class{constructor(){}static assertion(e){return pr._fromCredential(e)}};it.FACTOR_ID="phone";st=class{static assertionForEnrollment(e,n){return Yt._fromSecret(e,n)}static assertionForSignIn(e,n){return Yt._fromEnrollmentId(e,n)}static async generateSecret(e){let n=e;u(typeof n.user?.auth<"u","internal-error");let r=await fl(n.user.auth,{idToken:n.credential,totpEnrollmentInfo:{}});return ot._fromStartTotpMfaEnrollmentResponse(r,n.user.auth)}};st.FACTOR_ID="totp";Yt=class t extends Jt{constructor(e,n,r){super("totp"),this.otp=e,this.enrollmentId=n,this.secret=r}static _fromSecret(e,n){return new t(n,void 0,e)}static _fromEnrollmentId(e,n){return new t(n,e)}async _finalizeEnroll(e,n,r){return u(typeof this.secret<"u",e,"argument-error"),pl(e,{idToken:n,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)})}async _finalizeSignIn(e,n){u(this.enrollmentId!==void 0&&this.otp!==void 0,e,"argument-error");let r={verificationCode:this.otp};return Cl(e,{mfaPendingCredential:n,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r})}},ot=class t{constructor(e,n,r,i,s,a,c){this.sessionInfo=a,this.auth=c,this.secretKey=e,this.hashingAlgorithm=n,this.codeLength=r,this.codeIntervalSeconds=i,this.enrollmentCompletionDeadline=s}static _fromStartTotpMfaEnrollmentResponse(e,n){return new t(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,n)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,n){let r=!1;return(bt(e)||bt(n))&&(r=!0),r&&(bt(e)&&(e=this.auth.currentUser?.email||"unknownuser"),bt(n)&&(n=this.auth.name)),`otpauth://totp/${n}:${e}?secret=${this.secretKey}&issuer=${n}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}};Zi="@firebase/auth",Qi="1.13.3";mr=class{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 n=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};Eu=300,wu=In("authIdTokenMaxAge")||Eu,es=null,Tu=t=>async e=>{let n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>wu)return;let i=n?.token;es!==i&&(es=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};Nc({loadJS(t){return new Promise((e,n)=>{let r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{let s=k("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",vu().appendChild(r)})},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="});bu("Browser")});var Lo=U(()=>{Do();je();Ae();mt();pt()});var on={};Jr(on,{ActionCodeOperation:()=>ss,ActionCodeURL:()=>ge,AuthCredential:()=>Z,AuthErrorCodes:()=>ls,EmailAuthCredential:()=>Re,EmailAuthProvider:()=>Q,FacebookAuthProvider:()=>Ce,FactorId:()=>ts,GithubAuthProvider:()=>Ne,GoogleAuthProvider:()=>Oe,OAuthCredential:()=>$,OAuthProvider:()=>Dt,OperationType:()=>is,PhoneAuthCredential:()=>me,PhoneAuthProvider:()=>Le,PhoneMultiFactorGenerator:()=>it,ProviderId:()=>ns,RecaptchaVerifier:()=>Gt,SAMLAuthProvider:()=>Mt,SignInMethod:()=>rs,TotpMultiFactorGenerator:()=>st,TotpSecret:()=>ot,TwitterAuthProvider:()=>De,applyActionCode:()=>Vs,beforeAuthStateChanged:()=>Dr,browserCookiePersistence:()=>ho,browserLocalPersistence:()=>Lr,browserPopupRedirectResolver:()=>xr,browserSessionPersistence:()=>tn,checkActionCode:()=>Or,confirmPasswordReset:()=>xs,connectAuthEmulator:()=>Sr,createUserWithEmailAndPassword:()=>Ws,debugErrorMap:()=>as,deleteUser:()=>co,fetchSignInMethodsForEmail:()=>Gs,getAdditionalUserInfo:()=>Qs,getAuth:()=>No,getIdToken:()=>fs,getIdTokenResult:()=>Er,getMultiFactorResolver:()=>lo,getRedirectResult:()=>Po,inMemoryPersistence:()=>Ct,indexedDBLocalPersistence:()=>Ur,initializeAuth:()=>Ar,initializeRecaptchaConfig:()=>to,isSignInWithEmailLink:()=>$s,linkWithCredential:()=>Pr,linkWithPhoneNumber:()=>_o,linkWithPopup:()=>wo,linkWithRedirect:()=>ko,multiFactor:()=>uo,onAuthStateChanged:()=>ro,onIdTokenChanged:()=>Nr,parseActionCodeURL:()=>Ps,prodErrorMap:()=>gr,reauthenticateWithCredential:()=>Rr,reauthenticateWithPhoneNumber:()=>Io,reauthenticateWithPopup:()=>Eo,reauthenticateWithRedirect:()=>So,reload:()=>wr,revokeAccessToken:()=>ao,sendEmailVerification:()=>qs,sendPasswordResetEmail:()=>Fs,sendSignInLinkToEmail:()=>zs,setPersistence:()=>eo,signInAnonymously:()=>Cs,signInWithCredential:()=>ct,signInWithCustomToken:()=>Us,signInWithEmailAndPassword:()=>Bs,signInWithEmailLink:()=>js,signInWithPhoneNumber:()=>go,signInWithPopup:()=>bo,signInWithRedirect:()=>Ao,signOut:()=>oo,unlink:()=>Ds,updateCurrentUser:()=>so,updateEmail:()=>Ys,updatePassword:()=>Xs,updatePhoneNumber:()=>yo,updateProfile:()=>Js,useDeviceLanguage:()=>io,validatePassword:()=>no,verifyBeforeUpdateEmail:()=>Ks,verifyPasswordResetCode:()=>Hs});var an=U(()=>{Lo()});var Au={apiKey:"AIzaSyAC5ROxI3bnIO1DyNflMhFRrtnR-45p4RE",authDomain:"myapp-259bf.firebaseapp.com",projectId:"myapp-259bf"},Vr=null,cn=null;async function be(){return typeof window>"u"?null:(Vr||(Vr=(async()=>{let{initializeApp:t,getApps:e}=await Promise.resolve().then(()=>(Li(),Di)),{getAuth:n,signInAnonymously:r,onAuthStateChanged:i}=await Promise.resolve().then(()=>(an(),on)),s=e().length?e()[0]:t(Au);if(cn=n(s),!await new Promise(c=>{let l=i(cn,o=>{l(),c(o)})}))try{await r(cn)}catch(c){console.warn("[oZ Auth] Anonymous session created in offline mode or delayed:",c.message)}return cn})()),Vr)}async function Mo(){try{let t=await be();return!t||!t.currentUser?null:await t.currentUser.getIdToken()}catch(t){return console.error("[oZ Auth Debug]",t),null}}async function ln(t){let e=await be(),{signInWithCustomToken:n}=await Promise.resolve().then(()=>(an(),on)),r=await n(e,t);return{uid:r.user.uid,email:r.user.email,isAnonymous:r.user.isAnonymous}}async function Uo(){let t=await be(),{signOut:e,signInAnonymously:n}=await Promise.resolve().then(()=>(an(),on));return await e(t),await n(t),!0}async function Fo(){let t=await be();return!t||!t.currentUser?null:{uid:t.currentUser.uid,email:t.currentUser.email,isAnonymous:t.currentUser.isAnonymous}}async function xo(t=!1){try{let e=await be();return!e||!e.currentUser?!1:(await e.currentUser.getIdTokenResult(t)).claims.elog===!0}catch(e){return console.error("[oZ Auth Debug]",e),!1}}var Su="oz_proto",Hr="proto_user",dn=new Map,Vo=(t,e)=>`${Su}:${t||"app"}:${e}`,D=t=>t===void 0?t:JSON.parse(JSON.stringify(t)),Ho=()=>`proto_${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}`,zr=t=>{let e=t?._id??t?.id??t?.documentId;return e==null?null:String(e)},Wr=new Set;function te(t,e){let n=Vo(t,e);if(Wr.has(n))return D(dn.get(n));try{if(typeof localStorage<"u"){let r=localStorage.getItem(n);if(r!==null){let i=JSON.parse(r);if(Array.isArray(i))return i}}}catch{}return dn.has(n)?D(dn.get(n)):null}function lt(t,e,n){let r=Vo(t,e);dn.set(r,D(n));try{if(typeof localStorage<"u"){localStorage.setItem(r,JSON.stringify(n)),Wr.delete(r);return}}catch{}Wr.add(r)}var Br=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return{}}return t&&typeof t=="object"?t:{}};function ku(t,e,n){let r=String(e).split("."),i=t;r.forEach((s,a)=>{a===r.length-1?i[s]=n:((typeof i[s]!="object"||i[s]===null)&&(i[s]={}),i=i[s])})}function Pu(t){let e={...D(Br(t))};return e._id=zr(e)||Ho(),e}var un=(t,e)=>t.findIndex(n=>zr(n)===String(e));function Wo(t,e,n){let r=te(t,e);if(r!==null)return{success:!0,seeded:!1,isPrototype:!0,count:r.length};let i=(Array.isArray(n)?n:[]).map(Pu);return lt(t,e,i),{success:!0,seeded:!0,isPrototype:!0,count:i.length}}function Bo(t,e,n){let r=e||{},i=r.fleetboTable;switch(t){case"getdocsg":case"getdocsu":return{success:!0,data:D(te(n,i)||[])};case"getdoc":{let s=te(n,i)||[],a=s[un(s,r.id)];return a?{success:!0,data:D(a)}:{success:!1,notFound:!0,message:"Document not found."}}case"add":case"addwithmedia":{let s=te(n,i)||[],a=Br(r.jsonData),c={...D(a),_id:zr(a)||Ho(),userId:Hr,createdAt:new Date().toISOString()};if(t==="addwithmedia"){let l=typeof r.fileBase64=="string"&&r.fileBase64||a.mediaUrl||a.image||"";c.mediaUrl=c.image=c.imageUrl=c.coverImage=l}return s.push(c),lt(n,i,s),t==="addwithmedia"?{success:!0,id:c._id,mediaUrl:c.mediaUrl,isPrototype:!0}:{success:!0,documentId:c._id,isPrototype:!0}}case"addwithuserid":case"addwithid":{let s=te(n,i)||[],a=t==="addwithuserid"?Hr:String(r.id),c=D(Br(r.jsonData)),l=un(s,a),o={...l>=0?s[l]:{createdAt:new Date().toISOString()},...c,_id:a,userId:Hr,updatedAt:new Date().toISOString()};return l>=0?s[l]=o:s.push(o),lt(n,i,s),t==="addwithuserid"?{success:!0,documentId:a,isPrototype:!0}:{success:!0,id:a,isPrototype:!0}}case"update":{let s=te(n,i)||[],a=un(s,r.id);if(a<0)return{success:!1,documentId:r.id,error:"Document not found."};let{fleetboTable:c,id:l,...o}=r,d=D(s[a]);for(let[f,h]of Object.entries(o))ku(d,f,D(h));return d.updatedAt=new Date().toISOString(),s[a]=d,lt(n,i,s),{success:!0,documentId:String(r.id),isPrototype:!0}}case"delete":{let s=te(n,i)||[],a=un(s,r.id);return a>=0&&(s.splice(a,1),lt(n,i,s)),{success:!0,documentId:String(r.id),isPrototype:!0}}case"join":{let s=r.joinOptions?.innerJoin;if(!s||!s.collection||!Array.isArray(s.on)||s.on.length!==3)return{success:!1,error:"La clause 'on' doit contenir 3 \xE9l\xE9ments."};let[a,,c]=s.on,l=s.as||"joinedData",o=te(n,s.collection)||[],d=h=>{if(!Array.isArray(s.select)||s.select.length===0)return D(h);let I={_id:h._id};return s.select.forEach(b=>{b in h&&(I[b]=D(h[b]))}),I};return{success:!0,data:(te(n,i)||[]).map(h=>{let I=h[a],b=o.filter(C=>{if(I==null)return!1;let V=c==="id"?C._id??C.id:C[c];return String(V)===String(I)});return{...D(h),[l]:b.map(d)}})}}default:return null}}var Ru="https://fleetbo-gatekeeper.fleetbo.workers.dev/",ut=()=>typeof globalThis<"u"&&globalThis.OZ_CONFIG?globalThis.OZ_CONFIG:typeof window<"u"&&window.OZ_CONFIG?window.OZ_CONFIG:{},$r=()=>!!(typeof import.meta<"u"&&import.meta.env&&import.meta.env.OZ_PROTOTYPE==="true"||typeof process<"u"&&process.env&&process.env.OZ_PROTOTYPE==="true"||ut().prototype===!0||ut().prototype==="true"),jr=()=>(typeof import.meta<"u"&&import.meta.env?import.meta.env.OZ_DB_KEY:typeof process<"u"?process.env.OZ_DB_KEY:void 0)||ut().dbKey||"",Cu=()=>(typeof import.meta<"u"&&import.meta.env?import.meta.env.OZ_ENTERPRISE_ID:typeof process<"u"?process.env.OZ_ENTERPRISE_ID:void 0)||ut().enterpriseId||"",Ou=()=>!!(typeof import.meta<"u"&&import.meta.env&&import.meta.env.OZ_DEBUG==="true"||typeof process<"u"&&process.env&&process.env.OZ_DEBUG==="true"||ut().debug===!0),dt=async(t,e=null)=>{try{let n=jr(),r=Cu(),i=$r(),s=String(t).replace("https://","").split("-")[0]||"add",a=e?.operation||s,c=s==="crud"?"crud":a;if(i){let le=Bo(a.toLowerCase(),e,n);if(le!=null)return le}let l={"Content-Type":"application/json"};i&&(l["x-fleetbo-prototype"]="true",l["x-oz-prototype"]="true");let o=Ou()?Date.now():0,d=await Mo(),f=o?Date.now():0;d&&(l.Authorization=`Bearer ${d}`);let h=null;if(e?.jsonData!==void 0)h=e.jsonData;else if(a==="update"){let{fleetboTable:le,id:Uu,operation:Fu,...Ko}=e||{};h=Ko}let I={targetFunction:c,operation:a,enterpriseID:r,fleetboDB:n,fleetboTable:e?.fleetboTable||null,jsonData:h,_prototype:i,data:{fleetboDB:n,enterpriseID:r,operation:a,...e}},b=await fetch(Ru,{method:"POST",headers:l,body:JSON.stringify(I)}),C=await b.json(),V=C.result||C;if(o){let le=Date.now();console.debug(`[ozmoZ] ${c}(${e?.fleetboTable||""}) ${le-o} ms : auth ${f-o} ms, cloud ${le-f} ms, HTTP ${b.status}`)}let P=V?.error||(b.ok?null:V?.message||`HTTP ${b.status}`),O=P&&typeof P=="object"?P.message||JSON.stringify(P):P?String(P):void 0;return{success:!!(b.ok&&!O),...V||{},error:O}}catch(n){return{success:!1,error:n?.message||String(n)}}},zo=dt,$o=dt,jo=dt;var T=dt||zo||$o||jo,qo=$r||(()=>!1),Du=jr||(()=>"");if(typeof window<"u"&&typeof customElements<"u"){class t extends HTMLElement{static get observedAttributes(){return["value","fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null?this.removeAttribute("value"):this.setAttribute("value",String(o))}get fallback(){return this.getAttribute("fallback")}set fallback(o){o==null?this.removeAttribute("fallback"):this.setAttribute("fallback",String(o))}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("fallback")||"\u2014",f=o!=null&&o.trim()!==""&&o!=="null"&&o!=="undefined";this.textContent=f?o:d}}class e extends HTMLElement{static get observedAttributes(){return["value","invalid-fallback","currency"]}get value(){return this.getAttribute("value")}set value(o){o==null||o===""?this.removeAttribute("value"):this.setAttribute("value",String(o))}get currency(){return this.getAttribute("currency")}set currency(o){o==null?this.removeAttribute("currency"):this.setAttribute("currency",String(o))}get invalidFallback(){return this.getAttribute("invalid-fallback")}set invalidFallback(o){o==null?this.removeAttribute("invalid-fallback"):this.setAttribute("invalid-fallback",String(o))}get"invalid-fallback"(){return this.invalidFallback}set"invalid-fallback"(o){this.invalidFallback=o}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("invalid-fallback")||"0";if(o==null||o===""||o==="null"||o==="undefined"){this.textContent=d;return}let f=Number(o);if(Number.isNaN(f)){this.textContent=d;return}let h=this.getAttribute("currency");if(h)try{this.textContent=new Intl.NumberFormat("en-US",{style:"currency",currency:h}).format(f)}catch{this.textContent=`${f} ${h}`}else this.textContent=String(f)}}class n extends HTMLElement{static get observedAttributes(){return["value","label-true","label-false","invalid-fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null?this.removeAttribute("value"):this.setAttribute("value",String(o))}get labelTrue(){return this.getAttribute("label-true")}set labelTrue(o){o==null?this.removeAttribute("label-true"):this.setAttribute("label-true",String(o))}get"label-true"(){return this.labelTrue}set"label-true"(o){this.labelTrue=o}get labelFalse(){return this.getAttribute("label-false")}set labelFalse(o){o==null?this.removeAttribute("label-false"):this.setAttribute("label-false",String(o))}get"label-false"(){return this.labelFalse}set"label-false"(o){this.labelFalse=o}get invalidFallback(){return this.getAttribute("invalid-fallback")}set invalidFallback(o){o==null?this.removeAttribute("invalid-fallback"):this.setAttribute("invalid-fallback",String(o))}get"invalid-fallback"(){return this.invalidFallback}set"invalid-fallback"(o){this.invalidFallback=o}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("label-true")||"Yes",f=this.getAttribute("label-false")||"No",h=this.getAttribute("invalid-fallback")||"Unknown";o==="true"||o==="1"?this.textContent=d:o==="false"||o==="0"?this.textContent=f:this.textContent=h}}class r extends HTMLElement{static get observedAttributes(){return["value","locale","invalid-fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null||o===""?this.removeAttribute("value"):o&&typeof o=="object"&&typeof o.toISOString=="function"?this.setAttribute("value",o.toISOString()):this.setAttribute("value",String(o))}get locale(){return this.getAttribute("locale")}set locale(o){o==null?this.removeAttribute("locale"):this.setAttribute("locale",String(o))}get invalidFallback(){return this.getAttribute("invalid-fallback")}set invalidFallback(o){o==null?this.removeAttribute("invalid-fallback"):this.setAttribute("invalid-fallback",String(o))}get"invalid-fallback"(){return this.invalidFallback}set"invalid-fallback"(o){this.invalidFallback=o}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("invalid-fallback")||"Invalid date",f=this.getAttribute("locale")||"en-US";if(!o||o==="null"||o==="undefined"||o===""){this.textContent=d;return}let h=new Date(o);if(Number.isNaN(h.getTime())){this.textContent=d;return}try{this.textContent=h.toLocaleDateString(f)}catch{this.textContent=h.toLocaleDateString("en-US")}}}class i extends HTMLElement{static get observedAttributes(){return["value","allowed","invalid-fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null?this.removeAttribute("value"):this.setAttribute("value",String(o))}get allowed(){return this.getAttribute("allowed")}set allowed(o){o==null?this.removeAttribute("allowed"):Array.isArray(o)?this.setAttribute("allowed",o.join(",")):this.setAttribute("allowed",String(o))}get invalidFallback(){return this.getAttribute("invalid-fallback")}set invalidFallback(o){o==null?this.removeAttribute("invalid-fallback"):this.setAttribute("invalid-fallback",String(o))}get"invalid-fallback"(){return this.invalidFallback}set"invalid-fallback"(o){this.invalidFallback=o}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=(this.getAttribute("allowed")||"").split(",").map(h=>h.trim()).filter(Boolean),f=this.getAttribute("invalid-fallback")||"Not allowed";if(!o||o==="null"||o==="undefined"||!d.includes(o)){this.textContent=f;return}this.textContent=String(o)}}class s extends HTMLElement{static get observedAttributes(){return["value","alt","fallback"]}get value(){return this.getAttribute("value")}set value(o){o==null?this.removeAttribute("value"):this.setAttribute("value",String(o))}get alt(){return this.getAttribute("alt")}set alt(o){o==null?this.removeAttribute("alt"):this.setAttribute("alt",String(o))}get fallback(){return this.getAttribute("fallback")}set fallback(o){o==null?this.removeAttribute("fallback"):this.setAttribute("fallback",String(o))}attributeChangedCallback(){this.render()}connectedCallback(){this.render()}render(){let o=this.getAttribute("value"),d=this.getAttribute("fallback")||"",f=this.getAttribute("alt")||"Media";this.innerHTML="";let h=document.createElement("img"),I=o&&o!=="null"&&o!=="undefined"&&o.trim()!=="";h.src=I?o:d,h.alt=f,this.appendChild(h)}}class a extends HTMLElement{static get observedAttributes(){return["table","id","field","orphan-fallback","loading-fallback","malformed-fallback"]}get table(){return this.getAttribute("table")}set table(o){o==null?this.removeAttribute("table"):this.setAttribute("table",String(o))}get id(){return this.getAttribute("id")}set id(o){o==null?this.removeAttribute("id"):this.setAttribute("id",String(o))}get field(){return this.getAttribute("field")}set field(o){o==null?this.removeAttribute("field"):this.setAttribute("field",String(o))}get orphanFallback(){return this.getAttribute("orphan-fallback")}set orphanFallback(o){o==null?this.removeAttribute("orphan-fallback"):this.setAttribute("orphan-fallback",String(o))}get"orphan-fallback"(){return this.orphanFallback}set"orphan-fallback"(o){this.orphanFallback=o}get loadingFallback(){return this.getAttribute("loading-fallback")}set loadingFallback(o){o==null?this.removeAttribute("loading-fallback"):this.setAttribute("loading-fallback",String(o))}get"loading-fallback"(){return this.loadingFallback}set"loading-fallback"(o){this.loadingFallback=o}get malformedFallback(){return this.getAttribute("malformed-fallback")}set malformedFallback(o){o==null?this.removeAttribute("malformed-fallback"):this.setAttribute("malformed-fallback",String(o))}get"malformed-fallback"(){return this.malformedFallback}set"malformed-fallback"(o){this.malformedFallback=o}attributeChangedCallback(){this.fetchAndRender()}connectedCallback(){this.fetchAndRender()}async fetchAndRender(){let o=this.getAttribute("table"),d=this.getAttribute("id"),f=this.getAttribute("field")||"name",h=this.getAttribute("orphan-fallback")||"Deleted",I=this.getAttribute("loading-fallback")||"Loading...",b=this.getAttribute("malformed-fallback")||"Invalid ID";if(!d||typeof d!="string"||d.trim()===""||d==="null"||d==="undefined"){this.textContent=b;return}if(!o){this.textContent=b;return}this.textContent=I;try{let C=typeof window<"u"?window:null,V=typeof globalThis<"u"?globalThis:null,P=C&&C.oz||V&&V.oz;if(!P||typeof P.getDoc!="function"){this.textContent=h;return}let O=await P.getDoc(o,d);O&&O[f]!==void 0?this.textContent=String(O[f]):O?this.textContent=O.name||O.title||O.label||JSON.stringify(O):this.textContent=h}catch{this.textContent=h}}}let c=(l,o)=>{customElements.get(l)||customElements.define(l,o)};c("oz-text",t),c("oz-number",e),c("oz-toggle",n),c("oz-date",r),c("oz-enum",i),c("oz-media",s),c("oz-reference",a)}var qr={Text:"oz-text",Number:"oz-number",Toggle:"oz-toggle",Date:"oz-date",Enum:"oz-enum",Media:"oz-media",Reference:"oz-reference"};function Fe(t){typeof window>"u"&&typeof process<"u"&&process.env}var Lu=()=>!!(typeof import.meta<"u"&&import.meta.env&&import.meta.env.DEV===!0||typeof process<"u"&&process.env&&!1),Go=null;async function M(t){if(t&&t._schemaVersion&&t._schemaData){let e=t._schemaVersion,n=t._schemaData;typeof window<"u"?Lu()&&String(e)!==Go&&(Go=String(e),fetch("/__ozmoz_sync_schema",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({schema:n,version:e})}).catch(()=>{})):typeof process<"u"&&process.env}return t}var v=t=>`https://${t.toLowerCase()}-jqycakhlxa-uc.a.run.app`,hn=(t,e,n)=>{if(!n||n.success!==!1||n.notFound)return;let r=n.error,i=(r&&typeof r=="object"?r.message||r.status:r)||n.message||"unknown error";console.error(`[ozmoZ] ${t}('${e}') failed: ${i}`)};var xe=(t,e,n)=>{if(!n||n.success!==!1)return n;let r=n.error,i=(r&&typeof r=="object"?r.message||r.status:r)||n.message||"unknown error";return console.error(`[ozmoZ] ${t}('${e}') failed: ${i}`),n},Ee=null;function Gr(){if(typeof window>"u")return Promise.resolve(null);let t=window;return t.FB&&t.__ozmoz_fb_ready?Promise.resolve(t.FB):Ee||(Ee=new Promise((e,n)=>{let r=setTimeout(()=>{Ee=null,n(new Error("The Facebook service is not responding. Check your tracker blockers."))},8e3),i=typeof import.meta<"u"&&import.meta.env&&import.meta.env.OZ_FACEBOOK_APP_ID||typeof process<"u"&&process.env&&process.env.OZ_FACEBOOK_APP_ID||"1392432699758138",s=()=>{try{return t.__ozmoz_fb_ready?!0:!t.FB||typeof t.FB.init!="function"?!1:(t.FB.init({appId:String(i).trim(),cookie:!0,xfbml:!1,version:"v22.0"}),t.__ozmoz_fb_ready=!0,clearTimeout(r),e(t.FB),!0)}catch(l){return clearTimeout(r),Ee=null,n(l),!1}};if(t.FB&&typeof t.FB.init=="function"&&s())return;let a=t.fbAsyncInit;if(t.fbAsyncInit=function(){if(typeof a=="function")try{a()}catch{}s()},document.getElementById("facebook-jssdk"))return;let c=document.createElement("script");c.id="facebook-jssdk",c.src="https://connect.facebook.net/fr_FR/sdk.js",c.async=!0,c.defer=!0,c.crossOrigin="anonymous",c.onerror=()=>{clearTimeout(r),Ee=null,n(new Error("Could not load the Facebook script."))},document.head.appendChild(c)}),Ee)}typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Gr()}):Gr());var Mu=()=>new Proxy({},{get(t,e){let n=String(e);return async(r={})=>{let i=await T(v("call"),{functionName:n,payload:r});return M(i)}}}),j=t=>t&&(Array.isArray(t)?t.map(e=>e&&e._id&&!e.id?{...e,id:String(e._id)}:e):typeof t=="object"&&t._id&&!t.id?{...t,id:String(t._id)}:t),Ve=(t,e,n)=>{(!n||typeof n!="object"||!n.desc&&!n.guard&&!n.role)&&console.warn(`[ozmoZ] ${t}('${e}') : no {desc, guard, role} metadata provided \u2014 'npx ozmoz sync' will require it.`)},Kr={...qr,call:Mu(),getUser:Fo,add:async(t,e,n={})=>{Fe(t),Ve("add",t,n);let r=await T(v("crud"),{operation:"add",fleetboTable:t,jsonData:e});return xe("add",t,await M(r))},addWithId:async(t,e,n,r={})=>{Fe(t),Ve("addWithId",t,r);let i=await T(v("crud"),{operation:"addWithId",fleetboTable:t,id:n,jsonData:e});return xe("addWithId",t,await M(i))},addWithUserId:async(t,e,n={})=>{Fe(t),Ve("addWithUserId",t,n);let r=await T(v("crud"),{operation:"addWithUserId",fleetboTable:t,jsonData:e});return xe("addWithUserId",t,await M(r))},addWithMedia:async(t,e,n,r,i={})=>{Fe(t),Ve("addWithMedia",t,i);let s=await T(v("crud"),{operation:"addWithMedia",fleetboTable:t,jsonData:e,fileBase64:n,fileName:r});return xe("addWithMedia",t,await M(s))},update:async(t,e,n,r={})=>{Ve("update",t,r);let i=await T(v("crud"),{operation:"update",fleetboTable:t,id:e,...n});return xe("update",t,await M(i))},delete:async(t,e,n={})=>{Ve("delete",t,n);let r=await T(v("crud"),{operation:"delete",fleetboTable:t,id:e});return xe("delete",t,await M(r))},getDocsG:async t=>{let e=await T(v("crud"),{operation:"getDocsG",fleetboTable:t}),n=await M(e);return hn("getDocsG",t,n),Array.isArray(n)?j(n):n&&Array.isArray(n.data)?j(n.data):[]},getDocsU:async t=>{let e=await T(v("crud"),{operation:"getDocsU",fleetboTable:t}),n=await M(e);return hn("getDocsU",t,n),Array.isArray(n)?j(n):n&&Array.isArray(n.data)?j(n.data):[]},getDoc:async(t,e)=>{let n=await T(v("crud"),{operation:"getDoc",fleetboTable:t,id:e}),r=await M(n);return hn("getDoc",t,r),r?r.data!==void 0?j(r.data):r.success===!1?null:j(r):null},getAuthUser:async()=>{let t=await T(v("crud"),{operation:"getAuthUser"}),e=await M(t);return e?e.data!==void 0?j(e.data):e.success===!1?null:j(e):null},join:async(t,e)=>{Fe(t),e?.innerJoin?.collection&&Fe(e.innerJoin.collection);let n=await T(v("crud"),{operation:"join",fleetboTable:t,joinOptions:e}),r=await M(n);return hn("join",t,r),Array.isArray(r)?j(r):r&&Array.isArray(r.data)?j(r.data):[]},seed:async(t,e)=>qo()?Wo(Du(),t,e):{success:!0,seeded:!1,isPrototype:!1},sendotpsvro:async t=>{let e=typeof t=="string"?{email:t}:t||{};return await T(v("sendOtpSvro"),e)},verifyotpsvro:async(t,e)=>{let n=await T(v("verifyOtpSvro"),{email:t,code:e});if(n.success&&n.customToken)try{return{success:!0,user:await ln(n.customToken)}}catch(r){return{success:!1,error:r.message}}return n},sendOtpByPhone:async t=>{let e=typeof t=="string"?{phoneNumber:t}:t||{};return await T(v("sendOtpByPhone"),e)},verifyOtpPhoneSvro:async(t,e)=>{let n=await T(v("verifyOtpPhoneSvro"),{phoneNumber:t,code:e});if(n.success&&n.customToken)try{return{success:!0,user:await ln(n.customToken)}}catch(r){return{success:!1,error:r.message}}return n},verifyFacebookAuth:(t={})=>new Promise(e=>{let n=typeof t=="string"?t:t?.accessToken,r=async c=>{try{let l=await T(v("verifyFacebookAuth"),{accessToken:c}),o=l.customToken||l.token;if(l.success&&o){let d=await ln(o);e({success:!0,user:d,profile:l.profile||null,projects:l.projects||[]})}else e(l)}catch(l){e({success:!1,error:l.message})}};if(n){r(n);return}if(typeof window>"u")return e({success:!1,error:"Not a browser environment."});let i=window;if(!i.FB||!i.__ozmoz_fb_ready||typeof i.FB.login!="function")return Gr(),e({success:!1,error:"The Meta service is starting up. Click the button again."});let s=setTimeout(()=>{e({success:!1,cancelled:!0,error:"Login timed out. The window was closed or blocked."})},12e4),a=t?.scope||"public_profile,email";try{i.FB.login(c=>{if(clearTimeout(s),!c||c.error)return e({success:!1,error:c?.error||"Window closed."});if(c.status==="unknown"||!c.authResponse?.accessToken)return e({success:!1,cancelled:!0,error:"Facebook sign-in cancelled."});r(c.authResponse.accessToken)},{scope:a,return_scopes:!0})}catch(c){clearTimeout(s),e({success:!1,error:c.message})}}),isAuthenticated:async(t=!1)=>await xo(t),logout:async()=>{try{return await Uo(),{success:!0}}catch(t){return{success:!1,error:t.message}}},acl:{grant:async(t,e,n,r="*")=>await T(v("grantAcl"),{targetUserId:t,action:e,resourceTable:n,resourceId:r}),revoke:async(t,e,n,r="*")=>await T(v("revokeAcl"),{targetUserId:t,action:e,resourceTable:n,resourceId:r}),can:async(t,e,n="*")=>{let r=await T(v("checkAcl"),{action:t,resourceTable:e,resourceId:n});return!!(r&&(r.allowed===!0||r.can===!0))}}},wd=Kr;typeof window<"u"&&(window.oz=Kr,window.OzUI=qr);typeof globalThis<"u"&&(globalThis.oz=Kr,globalThis.OzUI=qr);if(typeof window<"u"&&typeof document<"u"){let t=()=>setTimeout(()=>{qo()||be().catch(()=>{})},400);document.readyState==="complete"?t():window.addEventListener("load",t,{once:!0})}export{qr as OzUI,wd as default,Kr as oz};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@firebase/util/dist/index.esm.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*)
|
|
21
|
+
(**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2022 Google LLC
|
|
24
|
+
*
|
|
25
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
26
|
+
* you may not use this file except in compliance with the License.
|
|
27
|
+
* You may obtain a copy of the License at
|
|
28
|
+
*
|
|
29
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
30
|
+
*
|
|
31
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
32
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
33
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
34
|
+
* See the License for the specific language governing permissions and
|
|
35
|
+
* limitations under the License.
|
|
36
|
+
*)
|
|
37
|
+
(**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2021 Google LLC
|
|
40
|
+
*
|
|
41
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
42
|
+
* you may not use this file except in compliance with the License.
|
|
43
|
+
* You may obtain a copy of the License at
|
|
44
|
+
*
|
|
45
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
46
|
+
*
|
|
47
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
48
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
49
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
50
|
+
* See the License for the specific language governing permissions and
|
|
51
|
+
* limitations under the License.
|
|
52
|
+
*)
|
|
53
|
+
(**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2019 Google LLC
|
|
56
|
+
*
|
|
57
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
58
|
+
* you may not use this file except in compliance with the License.
|
|
59
|
+
* You may obtain a copy of the License at
|
|
60
|
+
*
|
|
61
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
62
|
+
*
|
|
63
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
64
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
65
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
66
|
+
* See the License for the specific language governing permissions and
|
|
67
|
+
* limitations under the License.
|
|
68
|
+
*)
|
|
69
|
+
(**
|
|
70
|
+
* @license
|
|
71
|
+
* Copyright 2020 Google LLC
|
|
72
|
+
*
|
|
73
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
74
|
+
* you may not use this file except in compliance with the License.
|
|
75
|
+
* You may obtain a copy of the License at
|
|
76
|
+
*
|
|
77
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
78
|
+
*
|
|
79
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
80
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
81
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
82
|
+
* See the License for the specific language governing permissions and
|
|
83
|
+
* limitations under the License.
|
|
84
|
+
*)
|
|
85
|
+
(**
|
|
86
|
+
* @license
|
|
87
|
+
* Copyright 2025 Google LLC
|
|
88
|
+
*
|
|
89
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
90
|
+
* you may not use this file except in compliance with the License.
|
|
91
|
+
* You may obtain a copy of the License at
|
|
92
|
+
*
|
|
93
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
94
|
+
*
|
|
95
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
96
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
97
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
98
|
+
* See the License for the specific language governing permissions and
|
|
99
|
+
* limitations under the License.
|
|
100
|
+
*)
|
|
101
|
+
|
|
102
|
+
@firebase/component/dist/esm/index.esm.js:
|
|
103
|
+
(**
|
|
104
|
+
* @license
|
|
105
|
+
* Copyright 2019 Google LLC
|
|
106
|
+
*
|
|
107
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
108
|
+
* you may not use this file except in compliance with the License.
|
|
109
|
+
* You may obtain a copy of the License at
|
|
110
|
+
*
|
|
111
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
112
|
+
*
|
|
113
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
115
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
+
* See the License for the specific language governing permissions and
|
|
117
|
+
* limitations under the License.
|
|
118
|
+
*)
|
|
119
|
+
|
|
120
|
+
@firebase/logger/dist/esm/index.esm.js:
|
|
121
|
+
(**
|
|
122
|
+
* @license
|
|
123
|
+
* Copyright 2017 Google LLC
|
|
124
|
+
*
|
|
125
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
126
|
+
* you may not use this file except in compliance with the License.
|
|
127
|
+
* You may obtain a copy of the License at
|
|
128
|
+
*
|
|
129
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
130
|
+
*
|
|
131
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
132
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
133
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
134
|
+
* See the License for the specific language governing permissions and
|
|
135
|
+
* limitations under the License.
|
|
136
|
+
*)
|
|
137
|
+
|
|
138
|
+
@firebase/app/dist/esm/index.esm.js:
|
|
139
|
+
(**
|
|
140
|
+
* @license
|
|
141
|
+
* Copyright 2019 Google LLC
|
|
142
|
+
*
|
|
143
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
144
|
+
* you may not use this file except in compliance with the License.
|
|
145
|
+
* You may obtain a copy of the License at
|
|
146
|
+
*
|
|
147
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
148
|
+
*
|
|
149
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
150
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
151
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
152
|
+
* See the License for the specific language governing permissions and
|
|
153
|
+
* limitations under the License.
|
|
154
|
+
*)
|
|
155
|
+
(**
|
|
156
|
+
* @license
|
|
157
|
+
* Copyright 2023 Google LLC
|
|
158
|
+
*
|
|
159
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
160
|
+
* you may not use this file except in compliance with the License.
|
|
161
|
+
* You may obtain a copy of the License at
|
|
162
|
+
*
|
|
163
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
164
|
+
*
|
|
165
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
166
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
167
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
168
|
+
* See the License for the specific language governing permissions and
|
|
169
|
+
* limitations under the License.
|
|
170
|
+
*)
|
|
171
|
+
(**
|
|
172
|
+
* @license
|
|
173
|
+
* Copyright 2021 Google LLC
|
|
174
|
+
*
|
|
175
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
176
|
+
* you may not use this file except in compliance with the License.
|
|
177
|
+
* You may obtain a copy of the License at
|
|
178
|
+
*
|
|
179
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
180
|
+
*
|
|
181
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
182
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
183
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
184
|
+
* See the License for the specific language governing permissions and
|
|
185
|
+
* limitations under the License.
|
|
186
|
+
*)
|
|
187
|
+
|
|
188
|
+
firebase/app/dist/esm/index.esm.js:
|
|
189
|
+
(**
|
|
190
|
+
* @license
|
|
191
|
+
* Copyright 2020 Google LLC
|
|
192
|
+
*
|
|
193
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
* you may not use this file except in compliance with the License.
|
|
195
|
+
* You may obtain a copy of the License at
|
|
196
|
+
*
|
|
197
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
*
|
|
199
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
* See the License for the specific language governing permissions and
|
|
203
|
+
* limitations under the License.
|
|
204
|
+
*)
|
|
205
|
+
|
|
206
|
+
@firebase/auth/dist/esm/index-d90d2ee5.js:
|
|
207
|
+
(**
|
|
208
|
+
* @license
|
|
209
|
+
* Copyright 2021 Google LLC
|
|
210
|
+
*
|
|
211
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
212
|
+
* you may not use this file except in compliance with the License.
|
|
213
|
+
* You may obtain a copy of the License at
|
|
214
|
+
*
|
|
215
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
216
|
+
*
|
|
217
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
218
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
219
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
220
|
+
* See the License for the specific language governing permissions and
|
|
221
|
+
* limitations under the License.
|
|
222
|
+
*)
|
|
223
|
+
(**
|
|
224
|
+
* @license
|
|
225
|
+
* Copyright 2020 Google LLC
|
|
226
|
+
*
|
|
227
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
228
|
+
* you may not use this file except in compliance with the License.
|
|
229
|
+
* You may obtain a copy of the License at
|
|
230
|
+
*
|
|
231
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
232
|
+
*
|
|
233
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
234
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
235
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
236
|
+
* See the License for the specific language governing permissions and
|
|
237
|
+
* limitations under the License.
|
|
238
|
+
*)
|
|
239
|
+
(**
|
|
240
|
+
* @license
|
|
241
|
+
* Copyright 2019 Google LLC
|
|
242
|
+
*
|
|
243
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
244
|
+
* you may not use this file except in compliance with the License.
|
|
245
|
+
* You may obtain a copy of the License at
|
|
246
|
+
*
|
|
247
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
248
|
+
*
|
|
249
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
250
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
251
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
252
|
+
* See the License for the specific language governing permissions and
|
|
253
|
+
* limitations under the License.
|
|
254
|
+
*)
|
|
255
|
+
(**
|
|
256
|
+
* @license
|
|
257
|
+
* Copyright 2022 Google LLC
|
|
258
|
+
*
|
|
259
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
260
|
+
* you may not use this file except in compliance with the License.
|
|
261
|
+
* You may obtain a copy of the License at
|
|
262
|
+
*
|
|
263
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
264
|
+
*
|
|
265
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
266
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
267
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
268
|
+
* See the License for the specific language governing permissions and
|
|
269
|
+
* limitations under the License.
|
|
270
|
+
*)
|
|
271
|
+
(**
|
|
272
|
+
* @license
|
|
273
|
+
* Copyright 2023 Google LLC
|
|
274
|
+
*
|
|
275
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
276
|
+
* you may not use this file except in compliance with the License.
|
|
277
|
+
* You may obtain a copy of the License at
|
|
278
|
+
*
|
|
279
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
280
|
+
*
|
|
281
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
282
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
283
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
284
|
+
* See the License for the specific language governing permissions and
|
|
285
|
+
* limitations under the License.
|
|
286
|
+
*)
|
|
287
|
+
(**
|
|
288
|
+
* @license
|
|
289
|
+
* Copyright 2025 Google LLC
|
|
290
|
+
*
|
|
291
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
292
|
+
* you may not use this file except in compliance with the License.
|
|
293
|
+
* You may obtain a copy of the License at
|
|
294
|
+
*
|
|
295
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
296
|
+
*
|
|
297
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
298
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
299
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
300
|
+
* See the License for the specific language governing permissions and
|
|
301
|
+
* limitations under the License.
|
|
302
|
+
*)
|
|
303
|
+
(**
|
|
304
|
+
* @license
|
|
305
|
+
* Copyright 2020 Google LLC.
|
|
306
|
+
*
|
|
307
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
308
|
+
* you may not use this file except in compliance with the License.
|
|
309
|
+
* You may obtain a copy of the License at
|
|
310
|
+
*
|
|
311
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
312
|
+
*
|
|
313
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
314
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
315
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
316
|
+
* See the License for the specific language governing permissions and
|
|
317
|
+
* limitations under the License.
|
|
318
|
+
*)
|
|
319
|
+
*/
|