1const qr=()=>{};var Kt={};/** 2 * @license 3 * Copyright 2017 Google LLC 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */const Rn=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},Gr=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],a=n[t++],c=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Pn={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(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,a=o?n[i+1]:0,c=i+2<n.length,u=c?n[i+2]:0,h=s>>2,f=(s&3)<<4|a>>4;let d=(a&15)<<2|u>>6,T=u&63;c||(T=64,o||(d=64)),r.push(t[h],t[f],t[d],t[T])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Rn(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Gr(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){const s=t[n.charAt(i++)],a=i<n.length?t[n.charAt(i)]:0;++i;const u=i<n.length?t[n.charAt(i)]:64;++i;const f=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||a==null||u==null||f==null)throw new jr;const d=s<<2|a>>4;if(r.push(d),u!==64){const T=a<<4&240|u>>2;if(r.push(T),f!==64){const S=u<<6&192|f;r.push(S)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class jr extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Kr=function(n){const e=Rn(n);return Pn.encodeByteArray(e,!0)},Cn=function(n){return Kr(n).replace(/\./g,"")},kn=function(n){try{return Pn.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** 17 * @license 18 * Copyright 2022 Google LLC 19 * 20 * Licensed under the Apache License, Version 2.0 (the "License"); 21 * you may not use this file except in compliance with the License. 22 * You may obtain a copy of the License at 23 * 24 * http://www.apache.org/licenses/LICENSE-2.0 25 * 26 * Unless required by applicable law or agreed to in writing, softw
26are 27 * distributed under the License is distributed on an "AS IS" BASIS, 28 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 * See the License for the specific language governing permissions and 30 * limitations under the License. 31 */function Yr(){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.")}/** 32 * @license 33 * Copyright 2022 Google LLC 34 * 35 * Licensed under the Apache License, Version 2.0 (the "License"); 36 * you may not use this file except in compliance with the License. 37 * You may obtain a copy of the License at 38 * 39 * http://www.apache.org/licenses/LICENSE-2.0 40 * 41 * Unless required by applicable law or agreed to in writing, software 42 * distributed under the License is distributed on an "AS IS" BASIS, 43 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 44 * See the License for the specific language governing permissions and 45 * limitations under the License. 46 */const Jr=()=>Yr().__FIREBASE_DEFAULTS__,Xr=()=>{if(typeof process>"u"||typeof Kt>"u")return;const n=Kt.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Qr=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&kn(n[1]);return e&&JSON.parse(e)},Pt=()=>{try{return qr()||Jr()||Xr()||Qr()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Zr=n=>{var e,t;return(t=(e=Pt())==null?void 0:e.emulatorHosts)==null?void 0:t[n]},Nn=()=>{var n;return(n=Pt())==null?void 0:n.config},On=n=>{var e;return(e=Pt())==null?void 0:e[`_${n}`]};/** 47 * @license 48 * Copyright 2017 Google LLC 49 * 50 * Licensed under the Apache License, Version 2.0 (the "License"); 51 * you may not use this file except in compliance with the License. 52 * You may obtain a copy of the License at 53 * 54 * http://www.apache.org/licenses/LICENSE-2.0 55 * 56 * Unless required by applicable law or agreed to in writing, software 57 * distributed under the License is distributed on an "AS IS" BASIS, 58 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 59 * See the License for the specific language governing permissions and 60 * limitations under the License. 61 */class ei{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/** 62 * @license 63 * Copyright 2025 Google LLC 64 * 65 * Licensed under the Apache License, Version 2.0 (the "License"); 66 * you may not use this file except in compliance with the License. 67 * You may obtain a copy of the License at 68 * 69 * http://www.apache.org/licenses/LICENSE-2.0 70 * 71 * Unless required by applicable law or agreed to in writing, software 72 * distributed under the License is distributed on an "AS IS" BASIS, 73 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 74 * See the License for the specific language governing permissions and 75 * limitations under the License. 76 */function Je(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}async function ti(n){return(await fetch(n,{credentials:"include"})).ok}const _e={};function ni(){const n={prod:[],emulator:[]};for(const e of Object.keys(_e))_e[e]?n.emulator.push(e):n.prod.push(e);return n}function ri(n){let e=document.getElementById(n),t=!1;return e||(e=document.createElement("div"),e.setAttribute("id",n),t=!0),{created:t,element:e}}let Yt=!1;function ii(n,e){if(typeof window>"u"||typeof document>"u"||!Je(window.location.host)||_e[n]===e||_e[n]||Yt)return;_e[n]=e;function t(d){return`__firebase__banner__${d}`}const r="__firebase__banner",s=ni().prod.length>0;function o(){const d=document.getElementById(r);d&&d.remove()}function a(d){d.style.display="flex",d.style.background="#7faaf0",d.style.position="fixed",d.style.bottom="5px",d.style.left="5px",d.style.padding=".5em",d.style.borderRadius="5px",d.style.alignItems="center"}function c(d,T){d.setAttribute("width","24"),d.setAttribute("id",T),d.setAttribute("height","24"),d.setAttribute("viewBox","0 0 24 24"),d.setAttribute("fill","none"),d.style.marginLeft="-6px"}function u(){const d=document.createElement("span");
76return d.style.cursor="pointer",d.style.marginLeft="16px",d.style.fontSize="24px",d.innerHTML=" ×",d.onclick=()=>{Yt=!0,o()},d}function h(d,T){d.setAttribute("id",T),d.innerText="Learn more",d.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",d.setAttribute("target","__blank"),d.style.paddingLeft="5px",d.style.textDecoration="underline"}function f(){const d=ri(r),T=t("text"),S=document.getElementById(T)||document.createElement("span"),fe=t("learnmore"),Ue=document.getElementById(fe)||document.createElement("a"),ee=t("preprendIcon"),te=document.getElementById(ee)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(d.created){const at=d.element;a(at),h(Ue,fe);const zr=u();c(te,ee),at.append(te,S,Ue,zr),document.body.appendChild(at)}s?(S.innerText="Preview backend disconnected.",te.innerHTML=`<g clip-path="url(#clip0_6013_33858)"> 77<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/> 78</g> 79<defs> 80<clipPath id="clip0_6013_33858"> 81<rect width="24" height="24" fill="white"/> 82</clipPath> 83</defs>`):(te.innerHTML=`<g clip-path="url(#clip0_6083_34804)"> 84<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/> 85</g> 86<defs> 87<clipPath id="clip0_6083_34804"> 88<rect width="24" height="24" fill="white"/> 89</clipPath> 90</defs>`,S.innerText="Preview backend running in this workspace."),S.setAttribute("id",T)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/** 91 * @license 92 * Copyright 2017 Google LLC 93 * 94 * Licensed under the Apache License, Version 2.0 (the "License"); 95 * you may not use this file except in compliance with the License. 96 * You may obtain a copy of the License at 97 * 98 * http://www.apache.org/licenses/LICENSE-2.0 99 * 100 * Unless required by applicable law or agreed to in writing, software 101 * distributed under the License is distributed on an "AS IS" BASIS, 102 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 103 * See the License for the specific language governing permissions and 104 * limitations under the License. 105 */function A(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function si(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(A())}function oi(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function ai(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function ci(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function ui(){const n=A();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function li(){try{return typeof indexedDB=="object"}catch{return!1}}function di(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var s;e(((s=i.error)==null?void 0:s.message)||"")}}catch(t){e(t)}})}/** 106 * @license 107 * Copyright 2017 Google LLC 108 * 109 * Licensed under the Apache License, Version 2.0 (the "License");
110 * you may not use this file except in compliance with the License. 111 * You may obtain a copy of the License at 112 * 113 * http://www.apache.org/licenses/LICENSE-2.0 114 * 115 * Unless required by applicable law or agreed to in writing, software 116 * distributed under the License is distributed on an "AS IS" BASIS, 117 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 118 * See the License for the specific language governing permissions and 119 * limitations under the License. 120 */const hi="FirebaseError";class K extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=hi,Object.setPrototypeOf(this,K.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ke.prototype.create)}}class ke{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?fi(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new K(i,a,r)}}function fi(n,e){return n.replace(pi,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const pi=/\{\$([^}]+)}/g;function mi(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function se(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(Jt(s)&&Jt(o)){if(!se(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function Jt(n){return n!==null&&typeof n=="object"}/** 121 * @license 122 * Copyright 2017 Google LLC 123 * 124 * Licensed under the Apache License, Version 2.0 (the "License"); 125 * you may not use this file except in compliance with the License. 126 * You may obtain a copy of the License at 127 * 128 * http://www.apache.org/licenses/LICENSE-2.0 129 * 130 * Unless required by applicable law or agreed to in writing, software 131 * distributed under the License is distributed on an "AS IS" BASIS, 132 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 133 * See the License for the specific language governing permissions and 134 * limitations under the License. 135 */function ce(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function me(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function ge(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function gi(n,e){const t=new Ii(n,e);return t.subscribe.bind(t)}class Ii{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");_i(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=ct),i.error===void 0&&(i.error=ct),i.complete===void 0&&(i.complete=ct);const 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 t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(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}))}}function _i(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function ct(){}/** 136 * @license 137 * Copyright 2021 Google LLC 138 * 139 * Licensed under the Apache License, Version 2.0 (the "License");
140 * you may not use this file except in compliance with the License. 141 * You may obtain a copy of the License at 142 * 143 * http://www.apache.org/licenses/LICENSE-2.0 144 * 145 * Unless required by applicable law or agreed to in writing, software 146 * distributed under the License is distributed on an "AS IS" BASIS, 147 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 148 * See the License for the specific language governing permissions and 149 * limitations under the License. 150 */function p(n){return n&&n._delegate?n._delegate:n}class oe{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** 151 * @license 152 * Copyright 2019 Google LLC 153 * 154 * Licensed under the Apache License, Version 2.0 (the "License"); 155 * you may not use this file except in compliance with the License. 156 * You may obtain a copy of the License at 157 * 158 * http://www.apache.org/licenses/LICENSE-2.0 159 * 160 * Unless required by applicable law or agreed to in writing, software 161 * distributed under the License is distributed on an "AS IS" BASIS, 162 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 163 * See the License for the specific language governing permissions and 164 * limitations under the License. 165 */const J="[DEFAULT]";/** 166 * @license 167 * Copyright 2019 Google LLC 168 * 169 * Licensed under the Apache License, Version 2.0 (the "License"); 170 * you may not use this file except in compliance with the License. 171 * You may obtain a copy of the License at 172 * 173 * http://www.apache.org/licenses/LICENSE-2.0 174 * 175 * Unless required by applicable law or agreed to in writing, software 176 * distributed under the License is distributed on an "AS IS" BASIS, 177 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 178 * See the License for the specific language governing permissions and 179 * limitations under the License. 180 */class Ei{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new ei;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(e==null?void 0:e.optional)??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}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(Ti(e))try{this.getOrInitializeService({instanceIdentifier:J})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=J){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=J){return this.instances.has(e)}getOptions(e=J){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,t){const r=this.normalizeInstanceIdentifier(t),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:yi(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=J){return this.component?this.component.multipleInstances?e:J:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function yi(n){return n===J?void 0:n}function Ti(n){return n.instantiationMode==="EAGER"}/** 181 * @license 182 * Copyright 2019 Google LLC 183 * 184 * Licensed under the Apache License, Version 2.0 (the "License");
185 * you may not use this file except in compliance with the License. 186 * You may obtain a copy of the License at 187 * 188 * http://www.apache.org/licenses/LICENSE-2.0 189 * 190 * Unless required by applicable law or agreed to in writing, software 191 * distributed under the License is distributed on an "AS IS" BASIS, 192 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 193 * See the License for the specific language governing permissions and 194 * limitations under the License. 195 */class wi{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new Ei(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/** 196 * @license 197 * Copyright 2017 Google LLC 198 * 199 * Licensed under the Apache License, Version 2.0 (the "License"); 200 * you may not use this file except in compliance with the License. 201 * You may obtain a copy of the License at 202 * 203 * http://www.apache.org/licenses/LICENSE-2.0 204 * 205 * Unless required by applicable law or agreed to in writing, software 206 * distributed under the License is distributed on an "AS IS" BASIS, 207 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 208 * See the License for the specific language governing permissions and 209 * limitations under the License. 210 */var m;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(m||(m={}));const vi={debug:m.DEBUG,verbose:m.VERBOSE,info:m.INFO,warn:m.WARN,error:m.ERROR,silent:m.SILENT},Ai=m.INFO,bi={[m.DEBUG]:"log",[m.VERBOSE]:"log",[m.INFO]:"info",[m.WARN]:"warn",[m.ERROR]:"error"},Si=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=bi[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Dn{constructor(e){this.name=e,this._logLevel=Ai,this._logHandler=Si,this._userLogHandler=null}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"?vi[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)}}const Ri=(n,e)=>e.some(t=>n instanceof t);let Xt,Qt;function Pi(){return Xt||(Xt=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ci(){return Qt||(Qt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ln=new WeakMap,yt=new WeakMap,Mn=new WeakMap,ut=new WeakMap,Ct=new WeakMap;function ki(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(z(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Ln.set(t,n)}).catch(()=>{}),Ct.set(e,n),e}function Ni(n){if(yt.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});yt.set(n,e)}let Tt={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return yt.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Mn.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return z(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Oi(n){Tt=n(Tt)}
210function Di(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(lt(this),e,...t);return Mn.set(r,e.sort?e.sort():[e]),z(r)}:Ci().includes(n)?function(...e){return n.apply(lt(this),e),z(Ln.get(this))}:function(...e){return z(n.apply(lt(this),e))}}function Li(n){return typeof n=="function"?Di(n):(n instanceof IDBTransaction&&Ni(n),Ri(n,Pi())?new Proxy(n,Tt):n)}function z(n){if(n instanceof IDBRequest)return ki(n);if(ut.has(n))return ut.get(n);const e=Li(n);return e!==n&&(ut.set(n,e),Ct.set(e,n)),e}const lt=n=>Ct.get(n);function Mi(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),a=z(o);return r&&o.addEventListener("upgradeneeded",c=>{r(z(o.result),c.oldVersion,c.newVersion,z(o.transaction),c)}),t&&o.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const Ui=["get","getKey","getAll","getAllKeys","count"],Fi=["put","add","delete","clear"],dt=new Map;function Zt(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(dt.get(e))return dt.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=Fi.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Ui.includes(t)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let u=c.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[t](...a),i&&c.done]))[0]};return dt.set(e,s),s}Oi(n=>({...n,get:(e,t,r)=>Zt(e,t)||n.get(e,t,r),has:(e,t)=>!!Zt(e,t)||n.has(e,t)}));/** 211 * @license 212 * Copyright 2019 Google LLC 213 * 214 * Licensed under the Apache License, Version 2.0 (the "License"); 215 * you may not use this file except in compliance with the License. 216 * You may obtain a copy of the License at 217 * 218 * http://www.apache.org/licenses/LICENSE-2.0 219 * 220 * Unless required by applicable law or agreed to in writing, software 221 * distributed under the License is distributed on an "AS IS" BASIS, 222 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 223 * See the License for the specific language governing permissions and 224 * limitations under the License. 225 */class Vi{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(xi(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function xi(n){const e=n.getComponent();return(e==null?void 0:e.type)==="VERSION"}const wt="@firebase/app",en="0.14.6";/** 226 * @license 227 * Copyright 2019 Google LLC 228 * 229 * Licensed under the Apache License, Version 2.0 (the "License"); 230 * you may not use this file except in compliance with the License. 231 * You may obtain a copy of the License at 232 * 233 * http://www.apache.org/licenses/LICENSE-2.0 234 * 235 * Unless required by applicable law or agreed to in writing, software 236 * distributed under the License is distributed on an "AS IS" BASIS, 237 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 238 * See the License for the specific language governing permissions and 239 * limitations under the License. 240 */const V=new Dn("@firebase/app"),Hi="@firebase/app-compat",Bi="@firebase/analytics-compat",Wi="@firebase/analytics",$i="@firebase/app-check-compat",zi="@firebase/app-check",qi="@firebase/auth",Gi="@firebase/auth-compat",ji="@firebase/database",Ki="@firebase/data-connect",Yi="@firebase/database-compat",Ji="@firebase/functions",Xi="@firebase/functions-compat",Qi="@firebase/installations",Zi="@firebase/installations-compat",es="@firebase/messaging",ts="@firebase/messaging-compat",ns="@firebase/performance",rs="@firebase/performance-compat",is="@firebase/remote-config",ss="@firebase/remote-config-compat",os="@firebase/storage",as="@firebase/storage-compat",cs="@firebase/firestore",us="@firebase/ai",ls="@firebase/firestore-compat",ds="firebase",hs="12.6.0";/** 241 * @license 242 * Copyright 2019 Google LLC 243 * 244 * Licensed under the Apache License, Version 2.0 (the "License"); 245 * you may not use this file except in compliance with the License. 246 * You may obtain a copy of the License at 247 * 248 * http://www.apache.org/licenses/LICENSE-2.0 249 * 250 * Unless required by applicable law or agreed to in writing, softw
250are 251 * distributed under the License is distributed on an "AS IS" BASIS, 252 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 253 * See the License for the specific language governing permissions and 254 * limitations under the License. 255 */const vt="[DEFAULT]",fs={[wt]:"fire-core",[Hi]:"fire-core-compat",[Wi]:"fire-analytics",[Bi]:"fire-analytics-compat",[zi]:"fire-app-check",[$i]:"fire-app-check-compat",[qi]:"fire-auth",[Gi]:"fire-auth-compat",[ji]:"fire-rtdb",[Ki]:"fire-data-connect",[Yi]:"fire-rtdb-compat",[Ji]:"fire-fn",[Xi]:"fire-fn-compat",[Qi]:"fire-iid",[Zi]:"fire-iid-compat",[es]:"fire-fcm",[ts]:"fire-fcm-compat",[ns]:"fire-perf",[rs]:"fire-perf-compat",[is]:"fire-rc",[ss]:"fire-rc-compat",[os]:"fire-gcs",[as]:"fire-gcs-compat",[cs]:"fire-fst",[ls]:"fire-fst-compat",[us]:"fire-vertex","fire-js":"fire-js",[ds]:"fire-js-all"};/** 256 * @license 257 * Copyright 2019 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 */const $e=new Map,ps=new Map,At=new Map;function tn(n,e){try{n.container.addComponent(e)}catch(t){V.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Ae(n){const e=n.name;if(At.has(e))return V.debug(`There were multiple attempts to register component ${e}.`),!1;At.set(e,n);for(const t of $e.values())tn(t,n);for(const t of ps.values())tn(t,n);return!0}function Un(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function _(n){return n==null?!1:n.settings!==void 0}/** 271 * @license 272 * Copyright 2019 Google LLC 273 * 274 * Licensed under the Apache License, Version 2.0 (the "License"); 275 * you may not use this file except in compliance with the License. 276 * You may obtain a copy of the License at 277 * 278 * http://www.apache.org/licenses/LICENSE-2.0 279 * 280 * Unless required by applicable law or agreed to in writing, software 281 * distributed under the License is distributed on an "AS IS" BASIS, 282 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 283 * See the License for the specific language governing permissions and 284 * limitations under the License. 285 */const ms={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
285d-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."},q=new ke("app","Firebase",ms);/** 286 * @license 287 * Copyright 2019 Google LLC 288 * 289 * Licensed under the Apache License, Version 2.0 (the "License"); 290 * you may not use this file except in compliance with the License. 291 * You may obtain a copy of the License at 292 * 293 * http://www.apache.org/licenses/LICENSE-2.0 294 * 295 * Unless required by applicable law or agreed to in writing, software 296 * distributed under the License is distributed on an "AS IS" BASIS, 297 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 298 * See the License for the specific language governing permissions and 299 * limitations under the License. 300 */class gs{constructor(e,t,r){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new oe("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 q.create("app-deleted",{appName:this._name})}}/** 301 * @license 302 * Copyright 2019 Google LLC 303 * 304 * Licensed under the Apache License, Version 2.0 (the "License"); 305 * you may not use this file except in compliance with the License. 306 * You may obtain a copy of the License at 307 * 308 * http://www.apache.org/licenses/LICENSE-2.0 309 * 310 * Unless required by applicable law or agreed to in writing, software 311 * distributed under the License is distributed on an "AS IS" BASIS, 312 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 313 * See the License for the specific language governing permissions and 314 * limitations under the License. 315 */const Ne=hs;function Is(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r={name:vt,automaticDataCollectionEnabled:!0,...e},i=r.name;if(typeof i!="string"||!i)throw q.create("bad-app-name",{appName:String(i)});if(t||(t=Nn()),!t)throw q.create("no-options");const s=$e.get(i);if(s){if(se(t,s.options)&&se(r,s.config))return s;throw q.create("duplicate-app",{appName:i})}const o=new wi(i);for(const c of At.values())o.addComponent(c);const a=new gs(t,r,o);return $e.set(i,a),a}function _s(n=vt){const e=$e.get(n);if(!e&&n===vt&&Nn())return Is();if(!e)throw q.create("no-app",{appName:n});return e}function Ee(n,e,t){let r=fs[n]??n;t&&(r+=`-${t}`);const i=r.match(/\s|\//),s=e.match(/\s|\//);if(i||s){const o=[`Unable to register library "${r}" with version "${e}":`];i&&o.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&o.push("and"),s&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),V.warn(o.join(" "));return}Ae(new oe(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** 316 * @license 317 * Copyright 2021 Google LLC 318 * 319 * Licensed under the Apache License, Version 2.0 (the "License"); 320 * you may not use this file except in compliance with the License. 321 * You may obtain a copy of the License at 322 * 323 * http://www.apache.org/licenses/LICENSE-2.0 324 * 325 * Unless required by applicable law or agreed to in writing, softw
325are 326 * distributed under the License is distributed on an "AS IS" BASIS, 327 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 328 * See the License for the specific language governing permissions and 329 * limitations under the License. 330 */const Es="firebase-heartbeat-database",ys=1,be="firebase-heartbeat-store";let ht=null;function Fn(){return ht||(ht=Mi(Es,ys,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(be)}catch(t){console.warn(t)}}}}).catch(n=>{throw q.create("idb-open",{originalErrorMessage:n.message})})),ht}async function Ts(n){try{const t=(await Fn()).transaction(be),r=await t.objectStore(be).get(Vn(n));return await t.done,r}catch(e){if(e instanceof K)V.warn(e.message);else{const t=q.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});V.warn(t.message)}}}async function nn(n,e){try{const r=(await Fn()).transaction(be,"readwrite");await r.objectStore(be).put(e,Vn(n)),await r.done}catch(t){if(t instanceof K)V.warn(t.message);else{const r=q.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});V.warn(r.message)}}}function Vn(n){return`${n.name}!${n.options.appId}`}/** 331 * @license 332 * Copyright 2021 Google LLC 333 * 334 * Licensed under the Apache License, Version 2.0 (the "License"); 335 * you may not use this file except in compliance with the License. 336 * You may obtain a copy of the License at 337 * 338 * http://www.apache.org/licenses/LICENSE-2.0 339 * 340 * Unless required by applicable law or agreed to in writing, software 341 * distributed under the License is distributed on an "AS IS" BASIS, 342 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 343 * See the License for the specific language governing permissions and 344 * limitations under the License. 345 */const ws=1024,vs=30;class As{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Ss(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,t;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=rn();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s))return;if(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats.length>vs){const o=Rs(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){V.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=rn(),{heartbeatsToSend:r,unsentEntries:i}=bs(this._heartbeatsCache.heartbeats),s=Cn(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return V.warn(t),""}}}function rn(){return new Date().toISOString().substring(0,10)}function bs(n,e=ws){const t=[];let r=n.slice();for(const i of n){const s=t.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),sn(t)>e){s.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),sn(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class Ss{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return li()?di().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await Ts(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return nn(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return nn(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function sn(n){return Cn(JSON.stringify({version:2,heartbeats:n})).length}function Rs(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let r=1;r<n.length;r++)n[r].date<t&&(t=n[r].date,e=r);return e}/** 346 * @license 347 * Copyright 2019 Google LLC 348 * 349 * Licensed under the Apache License, Version 2.0 (the "License");
350 * you may not use this file except in compliance with the License. 351 * You may obtain a copy of the License at 352 * 353 * http://www.apache.org/licenses/LICENSE-2.0 354 * 355 * Unless required by applicable law or agreed to in writing, software 356 * distributed under the License is distributed on an "AS IS" BASIS, 357 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 358 * See the License for the specific language governing permissions and 359 * limitations under the License. 360 */function Ps(n){Ae(new oe("platform-logger",e=>new Vi(e),"PRIVATE")),Ae(new oe("heartbeat",e=>new As(e),"PRIVATE")),Ee(wt,en,n),Ee(wt,en,"esm2020"),Ee("fire-js","")}Ps("");/** 361 * @license 362 * Copyright 2021 Google LLC 363 * 364 * Licensed under the Apache License, Version 2.0 (the "License"); 365 * you may not use this file except in compliance with the License. 366 * You may obtain a copy of the License at 367 * 368 * http://www.apache.org/licenses/LICENSE-2.0 369 * 370 * Unless required by applicable law or agreed to in writing, software 371 * distributed under the License is distributed on an "AS IS" BASIS, 372 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 373 * See the License for the specific language governing permissions and 374 * limitations under the License. 375 */const Cs={PHONE:"phone",TOTP:"totp"},ks={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},Ns={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},Os={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},Ds={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"};/** 376 * @license 377 * Copyright 2020 Google LLC 378 * 379 * Licensed under the Apache License, Version 2.0 (the "License"); 380 * you may not use this file except in compliance with the License. 381 * You may obtain a copy of the License at 382 * 383 * http://www.apache.org/licenses/LICENSE-2.0 384 * 385 * Unless required by applicable law or agreed to in writing, software 386 * distributed under the License is distributed on an "AS IS" BASIS, 387 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 388 * See the License for the specific language governing permissions and 389 * limitations under the License. 390 */function Ls
vendor: 12,061 bytes, line 390
390(){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`)."}}
390function xn(){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."}}const Ms=Ls,Hn=xn,Bn=new ke("auth","Firebase",xn()),Us={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_
390NONCE:"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"};/** 391 * @license 392 * Copyright 2020 Google LLC 393 * 394 * Licensed under the Apache License, Version 2.0 (the "License"); 395 * you may not use this file except in compliance with the License. 396 * You may obtain a copy of the License at 397 * 398 * http://www.apache.org/licenses/LICENSE-2.0 399 * 400 * Unless required by applicable law or agreed to in writing, software 401 * distributed under the License is distributed on an "AS IS" BASIS, 402 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 403 * See the License for the specific language governing permissions and 404 * limitations under the License. 405 */const ze=new Dn("@firebase/auth");function Fs(n,...e){ze.logLevel<=m.WARN&&ze.warn(`Auth (${Ne}): ${n}`,...e)}function xe(n,...e){ze.logLevel<=m.ERROR&&ze.error(`Auth (${Ne}): ${n}`,...e)}/** 406 * @license 407 * Copyright 2020 Google LLC 408 * 409 * Licensed under the Apache License, Version 2.0 (the "License"); 410 * you may not use this file except in compliance with the License. 411 * You may obtain a copy of the License at 412 * 413 * http://www.apache.org/licenses/LICENSE-2.0 414 * 415 * Unless required by applicable law or agreed to in writing, software 416 * distributed under the License is distributed on an "AS IS" BASIS, 417 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 418 * See the License for the specific language governing permissions and 419 * limitations under the License. 420 */function b(n,...e){throw Nt(n,...e)}function v(n,...e){return Nt(n,...e)}function kt(n,e,t){const r={...Hn(),[e]:t};return new ke("auth","Firebase",r).create(e,{appName:n.name})}function w(n){return kt(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ue(n,e,t){const r=t;if(!(e instanceof r))throw r.name!==e.constructor.name&&b(n,"argument-error"),kt(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}
420function Nt(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return Bn.create(n,...e)}function l(n,e,...t){if(!n)throw Nt(e,...t)}function C(n){const e="INTERNAL ASSERTION FAILED: "+n;throw xe(e),new Error(e)}function x(n,e){n||C(e)}/** 421 * @license 422 * Copyright 2020 Google LLC 423 * 424 * Licensed under the Apache License, Version 2.0 (the "License"); 425 * you may not use this file except in compliance with the License. 426 * You may obtain a copy of the License at 427 * 428 * http://www.apache.org/licenses/LICENSE-2.0 429 * 430 * Unless required by applicable law or agreed to in writing, software 431 * distributed under the License is distributed on an "AS IS" BASIS, 432 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 433 * See the License for the specific language governing permissions and 434 * limitations under the License. 435 */function Se(){var n;return typeof self<"u"&&((n=self.location)==null?void 0:n.href)||""}function Ot(){return on()==="http:"||on()==="https:"}function on(){var n;return typeof self<"u"&&((n=self.location)==null?void 0:n.protocol)||null}/** 436 * @license 437 * Copyright 2020 Google LLC 438 * 439 * Licensed under the Apache License, Version 2.0 (the "License"); 440 * you may not use this file except in compliance with the License. 441 * You may obtain a copy of the License at 442 * 443 * http://www.apache.org/licenses/LICENSE-2.0 444 * 445 * Unless required by applicable law or agreed to in writing, software 446 * distributed under the License is distributed on an "AS IS" BASIS, 447 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 448 * See the License for the specific language governing permissions and 449 * limitations under the License. 450 */function Vs(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Ot()||ai()||"connection"in navigator)?navigator.onLine:!0}function xs(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/** 451 * @license 452 * Copyright 2020 Google LLC 453 * 454 * Licensed under the Apache License, Version 2.0 (the "License"); 455 * you may not use this file except in compliance with the License. 456 * You may obtain a copy of the License at 457 * 458 * http://www.apache.org/licenses/LICENSE-2.0 459 * 460 * Unless required by applicable law or agreed to in writing, software 461 * distributed under the License is distributed on an "AS IS" BASIS, 462 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 463 * See the License for the specific language governing permissions and 464 * limitations under the License. 465 */class Oe{constructor(e,t){this.shortDelay=e,this.longDelay=t,x(t>e,"Short delay should be less than long delay!"),this.isMobile=si()||ci()}get(){return Vs()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** 466 * @license 467 * Copyright 2020 Google LLC 468 * 469 * Licensed under the Apache License, Version 2.0 (the "License"); 470 * you may not use this file except in compliance with the License. 471 * You may obtain a copy of the License at 472 * 473 * http://www.apache.org/licenses/LICENSE-2.0 474 * 475 * Unless required by applicable law or agreed to in writing, software 476 * distributed under the License is distributed on an "AS IS" BASIS, 477 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 478 * See the License for the specific language governing permissions and 479 * limitations under the License. 480 */function Dt(n,e){x(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/** 481 * @license 482 * Copyright 2020 Google LLC 483 * 484 * Licensed under the Apache License, Version 2.0 (the "License"); 485 * you may not use this file except in compliance with the License. 486 * You may obtain a copy of the License at 487 * 488 * http://www.apache.org/licenses/LICENSE-2.0 489 * 490 * Unless required by applicable law or agreed to in writing, software 491 * distributed under the License is distributed on an "AS IS" BASIS, 492 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 493 * See the License for the specific language governing permissions and 494 * limitations under the License.
495 */class Wn{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),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;C("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;C("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;C("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** 496 * @license 497 * Copyright 2020 Google LLC 498 * 499 * Licensed under the Apache License, Version 2.0 (the "License"); 500 * you may not use this file except in compliance with the License. 501 * You may obtain a copy of the License at 502 * 503 * http://www.apache.org/licenses/LICENSE-2.0 504 * 505 * Unless required by applicable law or agreed to in writing, software 506 * distributed under the License is distributed on an "AS IS" BASIS, 507 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 508 * See the License for the specific language governing permissions and 509 * limitations under the License. 510 */const Hs={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"};/** 511 * @license 512 * Copyright 2020 Google LLC 513 * 514 * Licensed under the Apache License, Version 2.0 (the "License"); 515 * you may not use this file except in compliance with the License. 516 * You may obtain a copy of the License at 517 * 518 * http://www.apache.org/licenses/LICENSE-2.0 519 * 520 * Unless required by applicable law or agreed to in writing, softw
520are 521 * distributed under the License is distributed on an "AS IS" BASIS, 522 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 523 * See the License for the specific language governing permissions and 524 * limitations under the License. 525 */const Bs=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Ws=new Oe(3e4,6e4);function g(n,e){return n.tenantId&&!e.tenantId?{...e,tenantId:n.tenantId}:e}async function I(n,e,t,r,i={}){return $n(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=ce({key:n.config.apiKey,...o}).slice(1),c=await n._getAdditionalHeaders();c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode);const u={method:e,headers:c,...s};return oi()||(u.referrerPolicy="no-referrer"),n.emulatorConfig&&Je(n.emulatorConfig.host)&&(u.credentials="include"),Wn.fetch()(await zn(n,n.config.apiHost,t,a),u)})}async function $n(n,e,t){n._canInitEmulator=!1;const r={...Hs,...e};try{const i=new zs(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw Ie(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[c,u]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw Ie(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw Ie(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw Ie(n,"user-disabled",o);const h=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw kt(n,h,u);b(n,h)}}catch(i){if(i instanceof K)throw i;b(n,"network-request-failed",{message:String(i)})}}async function B(n,e,t,r,i={}){const s=await I(n,e,t,r,i);return"mfaPendingCredential"in s&&b(n,"multi-factor-auth-required",{_serverResponse:s}),s}async function zn(n,e,t,r){const i=`${e}${t}?${r}`,s=n,o=s.config.emulator?Dt(n.config,i):`${n.config.apiScheme}://${i}`;return Bs.includes(t)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(o).toString():o}function $s(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class zs{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(v(this.auth,"network-request-failed")),Ws.get())})}}function Ie(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=v(n,e,r);return i.customData._tokenResponse=t,i}/** 526 * @license 527 * Copyright 2020 Google LLC 528 * 529 * Licensed under the Apache License, Version 2.0 (the "License"); 530 * you may not use this file except in compliance with the License. 531 * You may obtain a copy of the License at 532 * 533 * http://www.apache.org/licenses/LICENSE-2.0 534 * 535 * Unless required by applicable law or agreed to in writing, software 536 * distributed under the License is distributed on an "AS IS" BASIS, 537 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 538 * See the License for the specific language governing permissions and 539 * limitations under the License. 540 */function an(n){return n!==void 0&&n.getResponse!==void 0}function cn(n){return n!==void 0&&n.enterprise!==void 0}class qn{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(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return $s(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PRO
540VIDER")}}/** 541 * @license 542 * Copyright 2020 Google LLC 543 * 544 * Licensed under the Apache License, Version 2.0 (the "License"); 545 * you may not use this file except in compliance with the License. 546 * You may obtain a copy of the License at 547 * 548 * http://www.apache.org/licenses/LICENSE-2.0 549 * 550 * Unless required by applicable law or agreed to in writing, software 551 * distributed under the License is distributed on an "AS IS" BASIS, 552 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 553 * See the License for the specific language governing permissions and 554 * limitations under the License. 555 */async function qs(n){return(await I(n,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function Gn(n,e){return I(n,"GET","/v2/recaptchaConfig",g(n,e))}/** 556 * @license 557 * Copyright 2020 Google LLC 558 * 559 * Licensed under the Apache License, Version 2.0 (the "License"); 560 * you may not use this file except in compliance with the License. 561 * You may obtain a copy of the License at 562 * 563 * http://www.apache.org/licenses/LICENSE-2.0 564 * 565 * Unless required by applicable law or agreed to in writing, software 566 * distributed under the License is distributed on an "AS IS" BASIS, 567 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 568 * See the License for the specific language governing permissions and 569 * limitations under the License. 570 */async function Gs(n,e){return I(n,"POST","/v1/accounts:delete",e)}async function js(n,e){return I(n,"POST","/v1/accounts:update",e)}async function qe(n,e){return I(n,"POST","/v1/accounts:lookup",e)}/** 571 * @license 572 * Copyright 2020 Google LLC 573 * 574 * Licensed under the Apache License, Version 2.0 (the "License"); 575 * you may not use this file except in compliance with the License. 576 * You may obtain a copy of the License at 577 * 578 * http://www.apache.org/licenses/LICENSE-2.0 579 * 580 * Unless required by applicable law or agreed to in writing, software 581 * distributed under the License is distributed on an "AS IS" BASIS, 582 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 583 * See the License for the specific language governing permissions and 584 * limitations under the License. 585 */function ye(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}/** 586 * @license 587 * Copyright 2020 Google LLC 588 * 589 * Licensed under the Apache License, Version 2.0 (the "License"); 590 * you may not use this file except in compliance with the License. 591 * You may obtain a copy of the License at 592 * 593 * http://www.apache.org/licenses/LICENSE-2.0 594 * 595 * Unless required by applicable law or agreed to in writing, software 596 * distributed under the License is distributed on an "AS IS" BASIS, 597 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 598 * See the License for the specific language governing permissions and 599 * limitations under the License. 600 */function Ks(n,e=!1){return p(n).getIdToken(e)}async function jn(n,e=!1){const t=p(n),r=await t.getIdToken(e),i=Xe(r);l(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:ye(ft(i.auth_time)),issuedAtTime:ye(ft(i.iat)),expirationTime:ye(ft(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function ft(n){return Number(n)*1e3}function Xe(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return xe("JWT malformed, contained fewer than 3 sections"),null;try{const i=kn(t);return i?JSON.parse(i):(xe("Failed to decode base64 JWT payload"),null)}catch(i){return xe("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function un(n){const e=Xe(n);return l(e,"internal-error"),l(typeof e.exp<"u","internal-error"),l(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** 601 * @license 602 * Copyright 2020 Google LLC 603 * 604 * Licensed under the Apache License, Version 2.0 (the "License"); 605 * you may not use this file except in compliance with the License. 606 * You may obtain a copy of the License at 607 * 608 * http://www.apache.org/licenses/LICENSE-2.0 609 * 610 * Unless required by applicable law or agreed to in writing, softw
610are 611 * distributed under the License is distributed on an "AS IS" BASIS, 612 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 613 * See the License for the specific language governing permissions and 614 * limitations under the License. 615 */async function H(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof K&&Ys(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function Ys({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/** 616 * @license 617 * Copyright 2020 Google LLC 618 * 619 * Licensed under the Apache License, Version 2.0 (the "License"); 620 * you may not use this file except in compliance with the License. 621 * You may obtain a copy of the License at 622 * 623 * http://www.apache.org/licenses/LICENSE-2.0 624 * 625 * Unless required by applicable law or agreed to in writing, software 626 * distributed under the License is distributed on an "AS IS" BASIS, 627 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 628 * See the License for the specific language governing permissions and 629 * limitations under the License. 630 */class Js{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){const t=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),t}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** 631 * @license 632 * Copyright 2020 Google LLC 633 * 634 * Licensed under the Apache License, Version 2.0 (the "License"); 635 * you may not use this file except in compliance with the License. 636 * You may obtain a copy of the License at 637 * 638 * http://www.apache.org/licenses/LICENSE-2.0 639 * 640 * Unless required by applicable law or agreed to in writing, software 641 * distributed under the License is distributed on an "AS IS" BASIS, 642 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 643 * See the License for the specific language governing permissions and 644 * limitations under the License. 645 */class bt{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=ye(this.lastLoginAt),this.creationTime=ye(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** 646 * @license 647 * Copyright 2019 Google LLC 648 * 649 * Licensed under the Apache License, Version 2.0 (the "License"); 650 * you may not use this file except in compliance with the License. 651 * You may obtain a copy of the License at 652 * 653 * http://www.apache.org/licenses/LICENSE-2.0 654 * 655 * Unless required by applicable law or agreed to in writing, software 656 * distributed under the License is distributed on an "AS IS" BASIS, 657 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 658 * See the License for the specific language governing permissions and 659 * limitations under the License. 660 */async function Re(n){var f;const e=n.auth,t=await n.getIdToken(),r=await H(n,qe(e,{idToken:t}));l(r==null?void 0:r.users.length,e,"internal-error");const i=r.users[0];n._notifyReloadListener(i);const s=(f=i.providerUserInfo)!=null&&f.length?Yn(i.providerUserInfo):[],o=Xs(n.providerData,s),a=n.isAnonymous,c=!(n.email&&i.passwordHash)&&!(o!=null&&o.length),u=a?c:!1,h={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:o,metadata:new bt(i.createdAt,i.lastLoginAt),isAnonymous:u};Object.assign(n,h)}async function Kn(n){const e=p(n);await Re(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Xs(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function Yn(n){return n.map(({providerId:e,...t})=>
660({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}/** 661 * @license 662 * Copyright 2020 Google LLC 663 * 664 * Licensed under the Apache License, Version 2.0 (the "License"); 665 * you may not use this file except in compliance with the License. 666 * You may obtain a copy of the License at 667 * 668 * http://www.apache.org/licenses/LICENSE-2.0 669 * 670 * Unless required by applicable law or agreed to in writing, software 671 * distributed under the License is distributed on an "AS IS" BASIS, 672 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 673 * See the License for the specific language governing permissions and 674 * limitations under the License. 675 */async function Qs(n,e){const t=await $n(n,{},async()=>{const r=ce({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=await zn(n,i,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const c={method:"POST",headers:a,body:r};return n.emulatorConfig&&Je(n.emulatorConfig.host)&&(c.credentials="include"),Wn.fetch()(o,c)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function Zs(n,e){return I(n,"POST","/v2/accounts:revokeToken",g(n,e))}/** 676 * @license 677 * Copyright 2020 Google LLC 678 * 679 * Licensed under the Apache License, Version 2.0 (the "License"); 680 * you may not use this file except in compliance with the License. 681 * You may obtain a copy of the License at 682 * 683 * http://www.apache.org/licenses/LICENSE-2.0 684 * 685 * Unless required by applicable law or agreed to in writing, software 686 * distributed under the License is distributed on an "AS IS" BASIS, 687 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 688 * See the License for the specific language governing permissions and 689 * limitations under the License. 690 */class ne{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){l(e.idToken,"internal-error"),l(typeof e.idToken<"u","internal-error"),l(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):un(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){l(e.length!==0,"internal-error");const t=un(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(l(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:i,expiresIn:s}=await Qs(e,t);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new ne;return r&&(l(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(l(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(l(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}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 ne,this.toJSON())}_performRefresh(){return C("not implemented")}}/** 691 * @license 692 * Copyright 2020 Google LLC 693 * 694 * Licensed under the Apache License, Version 2.0 (the "License"); 695 * you may not use this file except in compliance with the License. 696 * You may obtain a copy of the License at 697 * 698 * http://www.apache.org/licenses/LICENSE-2.0 699 * 700 * Unless required by applicable law or agreed to in writing, software 701 * distributed under the License is distributed on an "AS IS" BASIS, 702 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 703 * See the License for the specific language governing permissions and 704 * limitations under the License. 705 */function $(n,e){l(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class P{constructor({uid:e,auth:t,stsTokenManager:r,...i}){this.providerId="firebase",this.proactiveRefresh=new Js(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,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 bt(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await H(this,this.stsTokenManager.getToken(this.auth,e));return l(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return jn(this,e)}reload(){return Kn(this)}_assign(e){this!==e&&(l(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.ph
705otoURL,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(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new P({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){l(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await Re(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(_(this.auth.app))return Promise.reject(w(this.auth));const e=await this.getIdToken();return await H(this,Gs(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,t){const r=t.displayName??void 0,i=t.email??void 0,s=t.phoneNumber??void 0,o=t.photoURL??void 0,a=t.tenantId??void 0,c=t._redirectEventId??void 0,u=t.createdAt??void 0,h=t.lastLoginAt??void 0,{uid:f,emailVerified:d,isAnonymous:T,providerData:S,stsTokenManager:fe}=t;l(f&&fe,e,"internal-error");const Ue=ne.fromJSON(this.name,fe);l(typeof f=="string",e,"internal-error"),$(r,e.name),$(i,e.name),l(typeof d=="boolean",e,"internal-error"),l(typeof T=="boolean",e,"internal-error"),$(s,e.name),$(o,e.name),$(a,e.name),$(c,e.name),$(u,e.name),$(h,e.name);const ee=new P({uid:f,auth:e,email:i,emailVerified:d,displayName:r,isAnonymous:T,photoURL:o,phoneNumber:s,tenantId:a,stsTokenManager:Ue,createdAt:u,lastLoginAt:h});return S&&Array.isArray(S)&&(ee.providerData=S.map(te=>({...te}))),c&&(ee._redirectEventId=c),ee}static async _fromIdTokenResponse(e,t,r=!1){const i=new ne;i.updateFromServerResponse(t);const s=new P({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Re(s),s}static async _fromGetAccountInfoResponse(e,t,r){const i=t.users[0];l(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?Yn(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),a=new ne;a.updateFromIdToken(r);const c=new P({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),u={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 bt(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(c,u),c}}/** 706 * @license 707 * Copyright 2020 Google LLC 708 * 709 * Licensed under the Apache License, Version 2.0 (the "License"); 710 * you may not use this file except in compliance with the License. 711 * You may obtain a copy of the License at 712 * 713 * http://www.apache.org/licenses/LICENSE-2.0 714 * 715 * Unless required by applicable law or agreed to in writing, software 716 * distributed under the License is distributed on an "AS IS" BASIS, 717 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 718 * See the License for the specific language governing permissions and 719 * limitations under the License. 720 */const ln=new Map;function M(n){x(n instanceof Function,"Expected a class definition");let e=ln.get(n);return e?(x(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,ln.set(n,e),e)}/** 721 * @license 722 * Copyright 2019 Google LLC 723 * 724 * Licensed under the Apache License, Version 2.0 (the "License");
725 * you may not use this file except in compliance with the License. 726 * You may obtain a copy of the License at 727 * 728 * http://www.apache.org/licenses/LICENSE-2.0 729 * 730 * Unless required by applicable law or agreed to in writing, software 731 * distributed under the License is distributed on an "AS IS" BASIS, 732 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 733 * See the License for the specific language governing permissions and 734 * limitations under the License. 735 */class Jn{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Jn.type="NONE";const St=Jn;/** 736 * @license 737 * Copyright 2019 Google LLC 738 * 739 * Licensed under the Apache License, Version 2.0 (the "License"); 740 * you may not use this file except in compliance with the License. 741 * You may obtain a copy of the License at 742 * 743 * http://www.apache.org/licenses/LICENSE-2.0 744 * 745 * Unless required by applicable law or agreed to in writing, software 746 * distributed under the License is distributed on an "AS IS" BASIS, 747 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 748 * See the License for the specific language governing permissions and 749 * limitations under the License. 750 */function He(n,e,t){return`firebase:${n}:${e}:${t}`}class re{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=He(this.userKey,i.apiKey,s),this.fullPersistenceKey=He("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const t=await qe(this.auth,{idToken:e}).catch(()=>{});return t?P._fromGetAccountInfoResponse(this.auth,t,e):null}return P._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;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new re(M(St),e,r);const i=(await Promise.all(t.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let s=i[0]||M(St);const o=He(r,e.config.apiKey,e.name);let a=null;for(const u of t)try{const h=await u._get(o);if(h){let f;if(typeof h=="string"){const d=await qe(e,{idToken:h}).catch(()=>{});if(!d)break;f=await P._fromGetAccountInfoResponse(e,d,h)}else f=P._fromJSON(e,h);u!==s&&(a=f),s=u;break}}catch{}const c=i.filter(u=>u._shouldAllowMigration);return!s._shouldAllowMigration||!c.length?new re(s,e,r):(s=c[0],a&&await s._set(o,a.toJSON()),await Promise.all(t.map(async u=>{if(u!==s)try{await u._remove(o)}catch{}})),new re(s,e,r))}}/** 751 * @license 752 * Copyright 2020 Google LLC 753 * 754 * Licensed under the Apache License, Version 2.0 (the "License"); 755 * you may not use this file except in compliance with the License. 756 * You may obtain a copy of the License at 757 * 758 * http://www.apache.org/licenses/LICENSE-2.0 759 * 760 * Unless required by applicable law or agreed to in writing, software 761 * distributed under the License is distributed on an "AS IS" BASIS, 762 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 763 * See the License for the specific language governing permissions and 764 * limitations under the License. 765 */function dn(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(er(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Xn(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(nr(e))return"Blackberry";if(rr(e))return"Webos";if(Qn(e))return"Safari";if((e.includes("chrome/")||Zn(e))&&!e.includes("edge/"))return"Chrome";if(tr(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function Xn(n=A()){return/firefox\//i.test(n)}function Qn(n=A()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Zn(n=A()){return/crios\//i.test(n)}function er(n=A()){return/iemobile/i.test(n)}function tr(n=A()){return/android/i.test(n)}function nr(n=A()){return/blackberry/i.test(n)}function rr(n=A()){return/webos/i.test(n)}function Lt(n=A()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function eo(n=A()){var e;
765return Lt(n)&&!!((e=window.navigator)!=null&&e.standalone)}function to(){return ui()&&document.documentMode===10}function ir(n=A()){return Lt(n)||tr(n)||rr(n)||nr(n)||/windows phone/i.test(n)||er(n)}/** 766 * @license 767 * Copyright 2020 Google LLC 768 * 769 * Licensed under the Apache License, Version 2.0 (the "License"); 770 * you may not use this file except in compliance with the License. 771 * You may obtain a copy of the License at 772 * 773 * http://www.apache.org/licenses/LICENSE-2.0 774 * 775 * Unless required by applicable law or agreed to in writing, software 776 * distributed under the License is distributed on an "AS IS" BASIS, 777 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 778 * See the License for the specific language governing permissions and 779 * limitations under the License. 780 */function sr(n,e=[]){let t;switch(n){case"Browser":t=dn(A());break;case"Worker":t=`${dn(A())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Ne}/${r}`}/** 781 * @license 782 * Copyright 2022 Google LLC 783 * 784 * Licensed under the Apache License, Version 2.0 (the "License"); 785 * you may not use this file except in compliance with the License. 786 * You may obtain a copy of the License at 787 * 788 * http://www.apache.org/licenses/LICENSE-2.0 789 * 790 * Unless required by applicable law or agreed to in writing, software 791 * distributed under the License is distributed on an "AS IS" BASIS, 792 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 793 * See the License for the specific language governing permissions and 794 * limitations under the License. 795 */class no{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,a)=>{try{const c=e(s);o(c)}catch(c){a(c)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/** 796 * @license 797 * Copyright 2023 Google LLC 798 * 799 * Licensed under the Apache License, Version 2.0 (the "License"); 800 * you may not use this file except in compliance with the License. 801 * You may obtain a copy of the License at 802 * 803 * http://www.apache.org/licenses/LICENSE-2.0 804 * 805 * Unless required by applicable law or agreed to in writing, software 806 * distributed under the License is distributed on an "AS IS" BASIS, 807 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 808 * See the License for the specific language governing permissions and 809 * limitations under the License. 810 */async function ro(n,e={}){return I(n,"GET","/v2/passwordPolicy",g(n,e))}/** 811 * @license 812 * Copyright 2023 Google LLC 813 * 814 * Licensed under the Apache License, Version 2.0 (the "License"); 815 * you may not use this file except in compliance with the License. 816 * You may obtain a copy of the License at 817 * 818 * http://www.apache.org/licenses/LICENSE-2.0 819 * 820 * Unless required by applicable law or agreed to in writing, software 821 * distributed under the License is distributed on an "AS IS" BASIS, 822 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 823 * See the License for the specific language governing permissions and 824 * limitations under the License. 825 */const io=6;class so{constructor(e){var r;const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??io,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),t.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),t.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),t.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),t.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=e.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&
825(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/** 826 * @license 827 * Copyright 2020 Google LLC 828 * 829 * Licensed under the Apache License, Version 2.0 (the "License"); 830 * you may not use this file except in compliance with the License. 831 * You may obtain a copy of the License at 832 * 833 * http://www.apache.org/licenses/LICENSE-2.0 834 * 835 * Unless required by applicable law or agreed to in writing, software 836 * distributed under the License is distributed on an "AS IS" BASIS, 837 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 838 * See the License for the specific language governing permissions and 839 * limitations under the License.
840 */class oo{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new hn(this),this.idTokenSubscription=new hn(this),this.beforeStateQueue=new no(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=Bn,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,t){return t&&(this._popupRedirectResolver=M(t)),this._initializationPromise=this.queue(async()=>{var r,i,s;if(!this._deleted&&(this.persistenceManager=await re.create(this,e),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((i=this._popupRedirectResolver)!=null&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((s=this.currentUser)==null?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const 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{const t=await qe(this,{idToken:e}),r=await P._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var s;if(_(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let r=t,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(s=this.redirectUser)==null?void 0:s._redirectEventId,a=r==null?void 0:r._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===a)&&(c!=null&&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(o){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return l(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Re(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=xs()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(_(this.app))return Promise.reject(w(this));const t=e?p(e):null;return t&&l(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&l(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return _(this.app)?Promise.reject(w(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return _(this.app)?Promise.reject(w(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(M(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await ro(this),t=new so(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new ke("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>
840{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await Zs(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)==null?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&M(e)||this._popupRedirectResolver;l(t,this,"argument-error"),this.redirectPersistenceManager=await re.create(this,[M(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)==null?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)==null?void 0:r._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(){var t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((t=this.currentUser)==null?void 0:t.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(l(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const c=e.addObserver(t,r,i);return()=>{o=!0,c()}}else{const c=e.addObserver(t);return()=>{o=!0,c()}}}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 l(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=sr(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var i;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await((i=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:i.getHeartbeatsHeader());t&&(e["X-Firebase-Client"]=t);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){var t;if(_(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:t.getToken());return e!=null&&e.error&&Fs(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function E(n){return p(n)}class hn{constructor(e){this.auth=e,this.observer=null,this.addObserver=gi(t=>this.observer=t)}get next(){return l(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** 841 * @license 842 * Copyright 2020 Google LLC 843 * 844 * Licensed under the Apache License, Version 2.0 (the "License");
845 * you may not use this file except in compliance with the License. 846 * You may obtain a copy of the License at 847 * 848 * http://www.apache.org/licenses/LICENSE-2.0 849 * 850 * Unless required by applicable law or agreed to in writing, software 851 * distributed under the License is distributed on an "AS IS" BASIS, 852 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 853 * See the License for the specific language governing permissions and 854 * limitations under the License. 855 */let De={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function ao(n){De=n}function Mt(n){return De.loadJS(n)}function co(){return De.recaptchaV2Script}function uo(){return De.recaptchaEnterpriseScript}function lo(){return De.gapiScript}function or(n){return`__${n}${Math.floor(Math.random()*1e6)}`}/** 856 * @license 857 * Copyright 2020 Google LLC 858 * 859 * Licensed under the Apache License, Version 2.0 (the "License"); 860 * you may not use this file except in compliance with the License. 861 * You may obtain a copy of the License at 862 * 863 * http://www.apache.org/licenses/LICENSE-2.0 864 * 865 * Unless required by applicable law or agreed to in writing, software 866 * distributed under the License is distributed on an "AS IS" BASIS, 867 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 868 * See the License for the specific language governing permissions and 869 * limitations under the License. 870 */const ho=500,fo=6e4,Fe=1e12;class po{constructor(e){this.auth=e,this.counter=Fe,this._widgets=new Map}render(e,t){const r=this.counter;return this._widgets.set(r,new Io(e,this.auth.name,t||{})),this.counter++,r}reset(e){var r;const t=e||Fe;(r=this._widgets.get(t))==null||r.delete(),this._widgets.delete(t)}getResponse(e){var r;const t=e||Fe;return((r=this._widgets.get(t))==null?void 0:r.getResponse())||""}async execute(e){var r;const t=e||Fe;return(r=this._widgets.get(t))==null||r.execute(),""}}class mo{constructor(){this.enterprise=new go}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class go{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class Io{constructor(e,t,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const i=typeof e=="string"?document.getElementById(e):e;l(i,"argument-error",{appName:t}),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=_o(50);const{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch{}this.isVisible&&this.execute()},fo)},ho))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}function _o(n){const e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<n;r++)e.push(t.charAt(Math.floor(Math.random()*t.length)));return e.join("")}const Eo="recaptcha-enterprise",Te="NO_RECAPTCHA";class ar{constructor(e){this.type=Eo,this.auth=E(e)}async verify(e="verify",t=!1){async function r(s){if(!t){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(o,a)=>{Gn(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const u=new qn(c);return s.tenantId==null?s._agentRecaptchaConfig=u:s._tenantRecaptchaConfigs[s.tenantId]=u,o(u.siteKey)}}).catch(c=>{a(c)})})}function i(s,o,a){const c=window.grecaptcha;cn(c)?c.enterprise.ready(()=>{c.enterprise.execute(s,{action:e}).then(u=>{o(u)}).catch(()=>{o(Te)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new mo().execute("siteKey",{action:"verify"}):new Promise((s,o)=>{r(this.auth).then(a=>{if(!t&&cn(window.grecaptcha))i(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let c=uo();c.length!==0&&(c+=a),Mt(c).then(()=>{i(a,s,o)}).catch(u=>{o(u)})}}).catch(a=>{o(a)})})}}async function pe(n,e,t,r=!1,i=!1){const s=new ar(n);let o;if(i)o=Te;else try{o=await s.verify(t)}catch{o=await s.verify(t,!0)}const a={...e};if(t==="mfaSmsEnrollment"||t==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){const c=a.phoneEnrollmentInfo.phoneNumber,u=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:c,recaptchaToken:u,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}}
870)}else if("phoneSignInInfo"in a){const c=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function G(n,e,t,r,i){var s,o;if(i==="EMAIL_PASSWORD_PROVIDER")if((s=n._getRecaptchaConfig())!=null&&s.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const a=await pe(n,e,t,t==="getOobCode");return r(n,a)}else return r(n,e).catch(async a=>{if(a.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const c=await pe(n,e,t,t==="getOobCode");return r(n,c)}else return Promise.reject(a)});else if(i==="PHONE_PROVIDER")if((o=n._getRecaptchaConfig())!=null&&o.isProviderEnabled("PHONE_PROVIDER")){const a=await pe(n,e,t);return r(n,a).catch(async c=>{var u;if(((u=n._getRecaptchaConfig())==null?void 0:u.getProviderEnforcementState("PHONE_PROVIDER"))==="AUDIT"&&(c.code==="auth/missing-recaptcha-token"||c.code==="auth/invalid-app-credential")){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${t} flow.`);const h=await pe(n,e,t,!1,!0);return r(n,h)}return Promise.reject(c)})}else{const a=await pe(n,e,t,!1,!0);return r(n,a)}else return Promise.reject(i+" provider is not supported.")}async function cr(n){const e=E(n),t=await Gn(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new qn(t);e.tenantId==null?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,r.isAnyProviderEnabled()&&new ar(e).verify()}/** 871 * @license 872 * Copyright 2020 Google LLC 873 * 874 * Licensed under the Apache License, Version 2.0 (the "License"); 875 * you may not use this file except in compliance with the License. 876 * You may obtain a copy of the License at 877 * 878 * http://www.apache.org/licenses/LICENSE-2.0 879 * 880 * Unless required by applicable law or agreed to in writing, software 881 * distributed under the License is distributed on an "AS IS" BASIS, 882 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 883 * See the License for the specific language governing permissions and 884 * limitations under the License. 885 */function ur(n,e){const t=Un(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(se(s,e??{}))return i;b(i,"already-initialized")}return t.initialize({options:e})}function yo(n,e){const t=(e==null?void 0:e.persistence)||[],r=(Array.isArray(t)?t:[t]).map(M);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function lr(n,e,t){const r=E(n);
885l(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!(t!=null&&t.disableWarnings),s=dr(e),{host:o,port:a}=To(e),c=a===null?"":`:${a}`,u={url:`${s}//${o}${c}/`},h=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){l(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),l(se(u,r.config.emulator)&&se(h,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=h,r.settings.appVerificationDisabledForTesting=!0,Je(o)?(ti(`${s}//${o}${c}`),ii("Auth",!0)):i||wo()}function dr(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function To(n){const e=dr(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:fn(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:fn(o)}}}function fn(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function wo(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}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",n):n())}/** 886 * @license 887 * Copyright 2020 Google LLC 888 * 889 * Licensed under the Apache License, Version 2.0 (the "License"); 890 * you may not use this file except in compliance with the License. 891 * You may obtain a copy of the License at 892 * 893 * http://www.apache.org/licenses/LICENSE-2.0 894 * 895 * Unless required by applicable law or agreed to in writing, software 896 * distributed under the License is distributed on an "AS IS" BASIS, 897 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 898 * See the License for the specific language governing permissions and 899 * limitations under the License. 900 */class le{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return C("not implemented")}_getIdTokenResponse(e){return C("not implemented")}_linkToIdToken(e,t){return C("not implemented")}_getReauthenticationResolver(e){return C("not implemented")}}/** 901 * @license 902 * Copyright 2020 Google LLC 903 * 904 * Licensed under the Apache License, Version 2.0 (the "License"); 905 * you may not use this file except in compliance with the License. 906 * You may obtain a copy of the License at 907 * 908 * http://www.apache.org/licenses/LICENSE-2.0 909 * 910 * Unless required by applicable law or agreed to in writing, software 911 * distributed under the License is distributed on an "AS IS" BASIS, 912 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 913 * See the License for the specific language governing permissions and 914 * limitations under the License. 915 */async function hr(n,e){return I(n,"POST","/v1/accounts:resetPassword",g(n,e))}async function vo(n,e){return I(n,"POST","/v1/accounts:update",e)}async function Ao(n,e){return I(n,"POST","/v1/accounts:signUp",e)}async function bo(n,e){return I(n,"POST","/v1/accounts:update",g(n,e))}/** 916 * @license 917 * Copyright 2020 Google LLC 918 * 919 * Licensed under the Apache License, Version 2.0 (the "License"); 920 * you may not use this file except in compliance with the License. 921 * You may obtain a copy of the License at 922 * 923 * http://www.apache.org/licenses/LICENSE-2.0 924 * 925 * Unless required by applicable law or agreed to in writing, software 926 * distributed under the License is distributed on an "AS IS" BASIS, 927 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 928 * See the License for the specific language governing permissions and 929 * limitations under the License. 930 */async function So(n,e){return B(n,"POST","/v1/accounts:signInWithPassword",g(n,e))}async function Qe(n,e){return I(n,"POST","/v1/accounts:sendOobCode",g(n,e))}async function Ro(n,e){return Qe(n,e)}async function Po(n,e){return Qe(n,e)}async function Co(n,e){return Qe(n,e)}async function ko(n,e){return Qe(n,e)}/** 931 * @license 932 * Copyright 2020 Google LLC 933 * 934 * Licensed under the Apache License, Version 2.0 (the "License");
935 * you may not use this file except in compliance with the License. 936 * You may obtain a copy of the License at 937 * 938 * http://www.apache.org/licenses/LICENSE-2.0 939 * 940 * Unless required by applicable law or agreed to in writing, software 941 * distributed under the License is distributed on an "AS IS" BASIS, 942 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 943 * See the License for the specific language governing permissions and 944 * limitations under the License. 945 */async function No(n,e){return B(n,"POST","/v1/accounts:signInWithEmailLink",g(n,e))}async function Oo(n,e){return B(n,"POST","/v1/accounts:signInWithEmailLink",g(n,e))}/** 946 * @license 947 * Copyright 2020 Google LLC 948 * 949 * Licensed under the Apache License, Version 2.0 (the "License"); 950 * you may not use this file except in compliance with the License. 951 * You may obtain a copy of the License at 952 * 953 * http://www.apache.org/licenses/LICENSE-2.0 954 * 955 * Unless required by applicable law or agreed to in writing, software 956 * distributed under the License is distributed on an "AS IS" BASIS, 957 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 958 * See the License for the specific language governing permissions and 959 * limitations under the License. 960 */class ae extends le{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new ae(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new ae(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t!=null&&t.email&&(t!=null&&t.password)){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return G(e,t,"signInWithPassword",So,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return No(e,{email:this._email,oobCode:this._password});default:b(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":const r={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return G(e,r,"signUpPassword",Ao,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return Oo(e,{idToken:t,email:this._email,oobCode:this._password});default:b(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/** 961 * @license 962 * Copyright 2020 Google LLC 963 * 964 * Licensed under the Apache License, Version 2.0 (the "License"); 965 * you may not use this file except in compliance with the License. 966 * You may obtain a copy of the License at 967 * 968 * http://www.apache.org/licenses/LICENSE-2.0 969 * 970 * Unless required by applicable law or agreed to in writing, software 971 * distributed under the License is distributed on an "AS IS" BASIS, 972 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 973 * See the License for the specific language governing permissions and 974 * limitations under the License. 975 */async function F(n,e){return B(n,"POST","/v1/accounts:signInWithIdp",g(n,e))}/** 976 * @license 977 * Copyright 2020 Google LLC 978 * 979 * Licensed under the Apache License, Version 2.0 (the "License"); 980 * you may not use this file except in compliance with the License. 981 * You may obtain a copy of the License at 982 * 983 * http://www.apache.org/licenses/LICENSE-2.0 984 * 985 * Unless required by applicable law or agreed to in writing, software 986 * distributed under the License is distributed on an "AS IS" BASIS, 987 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 988 * See the License for the specific language governing permissions and 989 * limitations under the License. 990 */const Do="http://localhost";class k extends le{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new k(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&
990(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):b("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,...s}=t;if(!r||!i)return null;const o=new k(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return F(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,F(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,F(e,t)}buildRequest(){const e={requestUri:Do,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ce(t)}return e}}/** 991 * @license 992 * Copyright 2020 Google LLC 993 * 994 * Licensed under the Apache License, Version 2.0 (the "License"); 995 * you may not use this file except in compliance with the License. 996 * You may obtain a copy of the License at 997 * 998 * http://www.apache.org/licenses/LICENSE-2.0 999 * 1000 * Unless required by applicable law or agreed to in writing, software 1001 * distributed under the License is distributed on an "AS IS" BASIS, 1002 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1003 * See the License for the specific language governing permissions and 1004 * limitations under the License. 1005 */async function pn(n,e){return I(n,"POST","/v1/accounts:sendVerificationCode",g(n,e))}async function Lo(n,e){return B(n,"POST","/v1/accounts:signInWithPhoneNumber",g(n,e))}async function Mo(n,e){const t=await B(n,"POST","/v1/accounts:signInWithPhoneNumber",g(n,e));if(t.temporaryProof)throw Ie(n,"account-exists-with-different-credential",t);return t}const Uo={USER_NOT_FOUND:"user-not-found"};async function Fo(n,e){const t={...e,operation:"REAUTH"};return B(n,"POST","/v1/accounts:signInWithPhoneNumber",g(n,t),Uo)}/** 1006 * @license 1007 * Copyright 2020 Google LLC 1008 * 1009 * Licensed under the Apache License, Version 2.0 (the "License"); 1010 * you may not use this file except in compliance with the License. 1011 * You may obtain a copy of the License at 1012 * 1013 * http://www.apache.org/licenses/LICENSE-2.0 1014 * 1015 * Unless required by applicable law or agreed to in writing, software 1016 * distributed under the License is distributed on an "AS IS" BASIS, 1017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1018 * See the License for the specific language governing permissions and 1019 * limitations under the License. 1020 */class j extends le{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new j({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new j({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return Lo(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return Mo(e,{idToken:t,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return Fo(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:r,verificationCode:i}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:r,code:i}}toJSON(){const 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));const{verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:s}=e;return!r&&!t&&!i&&!s?null:new j({verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:s})}}/** 1021 * @license 1022 * Copyright 2020 Google LLC 1023 * 1024 * Licensed under the Apache License, Version 2.0 (the "License");
1025 * you may not use this file except in compliance with the License. 1026 * You may obtain a copy of the License at 1027 * 1028 * http://www.apache.org/licenses/LICENSE-2.0 1029 * 1030 * Unless required by applicable law or agreed to in writing, software 1031 * distributed under the License is distributed on an "AS IS" BASIS, 1032 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1033 * See the License for the specific language governing permissions and 1034 * limitations under the License. 1035 */function Vo(n){switch(n){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 xo(n){const e=me(ge(n)).link,t=e?me(ge(e)).deep_link_id:null,r=me(ge(n)).deep_link_id;return(r?me(ge(r)).link:null)||r||t||e||n}class de{constructor(e){const t=me(ge(e)),r=t.apiKey??null,i=t.oobCode??null,s=Vo(t.mode??null);l(r&&i&&s,"argument-error"),this.apiKey=r,this.operation=s,this.code=i,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){const t=xo(e);try{return new de(t)}catch{return null}}}function Ho(n){return de.parseLink(n)}/** 1036 * @license 1037 * Copyright 2020 Google LLC 1038 * 1039 * Licensed under the Apache License, Version 2.0 (the "License"); 1040 * you may not use this file except in compliance with the License. 1041 * You may obtain a copy of the License at 1042 * 1043 * http://www.apache.org/licenses/LICENSE-2.0 1044 * 1045 * Unless required by applicable law or agreed to in writing, software 1046 * distributed under the License is distributed on an "AS IS" BASIS, 1047 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1048 * See the License for the specific language governing permissions and 1049 * limitations under the License. 1050 */class Y{constructor(){this.providerId=Y.PROVIDER_ID}static credential(e,t){return ae._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=de.parseLink(t);return l(r,"argument-error"),ae._fromEmailAndCode(e,r.code,r.tenantId)}}Y.PROVIDER_ID="password";Y.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Y.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/** 1051 * @license 1052 * Copyright 2020 Google LLC 1053 * 1054 * Licensed under the Apache License, Version 2.0 (the "License"); 1055 * you may not use this file except in compliance with the License. 1056 * You may obtain a copy of the License at 1057 * 1058 * http://www.apache.org/licenses/LICENSE-2.0 1059 * 1060 * Unless required by applicable law or agreed to in writing, software 1061 * distributed under the License is distributed on an "AS IS" BASIS, 1062 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1063 * See the License for the specific language governing permissions and 1064 * limitations under the License. 1065 */class W{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}}/** 1066 * @license 1067 * Copyright 2019 Google LLC 1068 * 1069 * Licensed under the Apache License, Version 2.0 (the "License"); 1070 * you may not use this file except in compliance with the License. 1071 * You may obtain a copy of the License at 1072 * 1073 * http://www.apache.org/licenses/LICENSE-2.0 1074 * 1075 * Unless required by applicable law or agreed to in writing, software 1076 * distributed under the License is distributed on an "AS IS" BASIS, 1077 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1078 * See the License for the specific language governing permissions and 1079 * limitations under the License. 1080 */class he extends W{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class we extends he{static credentialFromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;return l("providerId"in t&&"signInMethod"in t,"argument-error"),k._fromParams(t)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return l(e.idToken||e.accessToken,"argument-error"),k._fromParams({...e,providerId:this.providerId,sign
1080InMethod:this.providerId})}static credentialFromResult(e){return we.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return we.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r,oauthTokenSecret:i,pendingToken:s,nonce:o,providerId:a}=e;if(!r&&!i&&!t&&!s||!a)return null;try{return new we(a)._credential({idToken:t,accessToken:r,nonce:o,pendingToken:s})}catch{return null}}}/** 1081 * @license 1082 * Copyright 2020 Google LLC 1083 * 1084 * Licensed under the Apache License, Version 2.0 (the "License"); 1085 * you may not use this file except in compliance with the License. 1086 * You may obtain a copy of the License at 1087 * 1088 * http://www.apache.org/licenses/LICENSE-2.0 1089 * 1090 * Unless required by applicable law or agreed to in writing, software 1091 * distributed under the License is distributed on an "AS IS" BASIS, 1092 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1093 * See the License for the specific language governing permissions and 1094 * limitations under the License. 1095 */class N extends he{constructor(){super("facebook.com")}static credential(e){return k._fromParams({providerId:N.PROVIDER_ID,signInMethod:N.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return N.credentialFromTaggedObject(e)}static credentialFromError(e){return N.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return N.credential(e.oauthAccessToken)}catch{return null}}}N.FACEBOOK_SIGN_IN_METHOD="facebook.com";N.PROVIDER_ID="facebook.com";/** 1096 * @license 1097 * Copyright 2020 Google LLC 1098 * 1099 * Licensed under the Apache License, Version 2.0 (the "License"); 1100 * you may not use this file except in compliance with the License. 1101 * You may obtain a copy of the License at 1102 * 1103 * http://www.apache.org/licenses/LICENSE-2.0 1104 * 1105 * Unless required by applicable law or agreed to in writing, software 1106 * distributed under the License is distributed on an "AS IS" BASIS, 1107 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1108 * See the License for the specific language governing permissions and 1109 * limitations under the License. 1110 */class O extends he{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return k._fromParams({providerId:O.PROVIDER_ID,signInMethod:O.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return O.credentialFromTaggedObject(e)}static credentialFromError(e){return O.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return O.credential(t,r)}catch{return null}}}O.GOOGLE_SIGN_IN_METHOD="google.com";O.PROVIDER_ID="google.com";/** 1111 * @license 1112 * Copyright 2020 Google LLC 1113 * 1114 * Licensed under the Apache License, Version 2.0 (the "License"); 1115 * you may not use this file except in compliance with the License. 1116 * You may obtain a copy of the License at 1117 * 1118 * http://www.apache.org/licenses/LICENSE-2.0 1119 * 1120 * Unless required by applicable law or agreed to in writing, software 1121 * distributed under the License is distributed on an "AS IS" BASIS, 1122 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1123 * See the License for the specific language governing permissions and 1124 * limitations under the License. 1125 */class D extends he{constructor(){super("github.com")}static credential(e){return k._fromParams({providerId:D.PROVIDER_ID,signInMethod:D.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return D.credentialFromTaggedObject(e)}static credentialFromError(e){return D.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return D.credential(e.oauthAccessToken)}catch{return null}}}D.GITHUB_SIGN_IN_METHOD="github.com";D.PROVIDER_ID="github.com";/** 1126 * @license 1127 * Copyright 2020 Google LLC 1128 * 1129 * Licensed under the Apache License, Version 2.0 (the "License");
1130 * you may not use this file except in compliance with the License. 1131 * You may obtain a copy of the License at 1132 * 1133 * http://www.apache.org/licenses/LICENSE-2.0 1134 * 1135 * Unless required by applicable law or agreed to in writing, software 1136 * distributed under the License is distributed on an "AS IS" BASIS, 1137 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1138 * See the License for the specific language governing permissions and 1139 * limitations under the License. 1140 */const Bo="http://localhost";class Pe extends le{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){const t=this.buildRequest();return F(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,F(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,F(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i,pendingToken:s}=t;return!r||!i||!s||r!==i?null:new Pe(r,s)}static _create(e,t){return new Pe(e,t)}buildRequest(){return{requestUri:Bo,returnSecureToken:!0,pendingToken:this.pendingToken}}}/** 1141 * @license 1142 * Copyright 2020 Google LLC 1143 * 1144 * Licensed under the Apache License, Version 2.0 (the "License"); 1145 * you may not use this file except in compliance with the License. 1146 * You may obtain a copy of the License at 1147 * 1148 * http://www.apache.org/licenses/LICENSE-2.0 1149 * 1150 * Unless required by applicable law or agreed to in writing, software 1151 * distributed under the License is distributed on an "AS IS" BASIS, 1152 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1153 * See the License for the specific language governing permissions and 1154 * limitations under the License. 1155 */const Wo="saml.";class Ge extends W{constructor(e){l(e.startsWith(Wo),"argument-error"),super(e)}static credentialFromResult(e){return Ge.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return Ge.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){const t=Pe.fromJSON(e);return l(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{pendingToken:t,providerId:r}=e;if(!t||!r)return null;try{return Pe._create(r,t)}catch{return null}}}/** 1156 * @license 1157 * Copyright 2020 Google LLC 1158 * 1159 * Licensed under the Apache License, Version 2.0 (the "License"); 1160 * you may not use this file except in compliance with the License. 1161 * You may obtain a copy of the License at 1162 * 1163 * http://www.apache.org/licenses/LICENSE-2.0 1164 * 1165 * Unless required by applicable law or agreed to in writing, software 1166 * distributed under the License is distributed on an "AS IS" BASIS, 1167 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1168 * See the License for the specific language governing permissions and 1169 * limitations under the License. 1170 */class L extends he{constructor(){super("twitter.com")}static credential(e,t){return k._fromParams({providerId:L.PROVIDER_ID,signInMethod:L.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return L.credentialFromTaggedObject(e)}static credentialFromError(e){return L.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return L.credential(t,r)}catch{return null}}}L.TWITTER_SIGN_IN_METHOD="twitter.com";L.PROVIDER_ID="twitter.com";/** 1171 * @license 1172 * Copyright 2020 Google LLC 1173 * 1174 * Licensed under the Apache License, Version 2.0 (the "License"); 1175 * you may not use this file except in compliance with the License. 1176 * You may obtain a copy of the License at 1177 * 1178 * http://www.apache.org/licenses/LICENSE-2.0 1179 * 1180 * Unless required by applicable law or agreed to in writing, software 1181 * distributed under the License is distributed on an "AS IS" BASIS, 1182 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1183 * See the License for the specific language governing permissions and 1184 * limitations under the License. 1185 */async function fr(n,e){return B(n,"POST","/v1/accounts:signUp",g(n,e))}/** 1186 * @license 1187 * Copyright 2020 Google LLC 1188 * 1189 * Licensed under the Apache License, Version 2.0 (the "License");
1190 * you may not use this file except in compliance with the License. 1191 * You may obtain a copy of the License at 1192 * 1193 * http://www.apache.org/licenses/LICENSE-2.0 1194 * 1195 * Unless required by applicable law or agreed to in writing, software 1196 * distributed under the License is distributed on an "AS IS" BASIS, 1197 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1198 * See the License for the specific language governing permissions and 1199 * limitations under the License. 1200 */class R{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,i=!1){const s=await P._fromIdTokenResponse(e,r,i),o=mn(r);return new R({user:s,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const i=mn(r);return new R({user:e,providerId:i,_tokenResponse:r,operationType:t})}}function mn(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/** 1201 * @license 1202 * Copyright 2020 Google LLC 1203 * 1204 * Licensed under the Apache License, Version 2.0 (the "License"); 1205 * you may not use this file except in compliance with the License. 1206 * You may obtain a copy of the License at 1207 * 1208 * http://www.apache.org/licenses/LICENSE-2.0 1209 * 1210 * Unless required by applicable law or agreed to in writing, software 1211 * distributed under the License is distributed on an "AS IS" BASIS, 1212 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1213 * See the License for the specific language governing permissions and 1214 * limitations under the License. 1215 */async function $o(n){var i;if(_(n.app))return Promise.reject(w(n));const e=E(n);if(await e._initializationPromise,(i=e.currentUser)!=null&&i.isAnonymous)return new R({user:e.currentUser,providerId:null,operationType:"signIn"});const t=await fr(e,{returnSecureToken:!0}),r=await R._fromIdTokenResponse(e,"signIn",t,!0);return await e._updateCurrentUser(r.user),r}/** 1216 * @license 1217 * Copyright 2020 Google LLC 1218 * 1219 * Licensed under the Apache License, Version 2.0 (the "License"); 1220 * you may not use this file except in compliance with the License. 1221 * You may obtain a copy of the License at 1222 * 1223 * http://www.apache.org/licenses/LICENSE-2.0 1224 * 1225 * Unless required by applicable law or agreed to in writing, software 1226 * distributed under the License is distributed on an "AS IS" BASIS, 1227 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1228 * See the License for the specific language governing permissions and 1229 * limitations under the License.
1230 */class je extends K{constructor(e,t,r,i){super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,je.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new je(e,t,r,i)}}function pr(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?je._fromErrorAndOperation(n,s,e,r):s})}/** 1231 * @license 1232 * Copyright 2020 Google LLC 1233 * 1234 * Licensed under the Apache License, Version 2.0 (the "License"); 1235 * you may not use this file except in compliance with the License. 1236 * You may obtain a copy of the License at 1237 * 1238 * http://www.apache.org/licenses/LICENSE-2.0 1239 * 1240 * Unless required by applicable law or agreed to in writing, software 1241 * distributed under the License is distributed on an "AS IS" BASIS, 1242 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1243 * See the License for the specific language governing permissions and 1244 * limitations under the License. 1245 */function mr(n){return new Set(n.map(({providerId:e})=>e).filter(e=>!!e))}/** 1246 * @license 1247 * Copyright 2019 Google LLC 1248 * 1249 * Licensed under the Apache License, Version 2.0 (the "License"); 1250 * you may not use this file except in compliance with the License. 1251 * You may obtain a copy of the License at 1252 * 1253 * http://www.apache.org/licenses/LICENSE-2.0 1254 * 1255 * Unless required by applicable law or agreed to in writing, software 1256 * distributed under the License is distributed on an "AS IS" BASIS, 1257 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1258 * See the License for the specific language governing permissions and 1259 * limitations under the License. 1260 */async function zo(n,e){const t=p(n);await Ze(!0,t,e);const{providerUserInfo:r}=await js(t.auth,{idToken:await t.getIdToken(),deleteProvider:[e]}),i=mr(r||[]);return t.providerData=t.providerData.filter(s=>i.has(s.providerId)),i.has("phone")||(t.phoneNumber=null),await t.auth._persistUserIfCurrent(t),t}async function Ut(n,e,t=!1){const r=await H(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return R._forOperation(n,"link",r)}async function Ze(n,e,t){await Re(e);const r=mr(e.providerData),i=n===!1?"provider-already-linked":"no-such-provider";l(r.has(t)===n,e.auth,i)}/** 1261 * @license 1262 * Copyright 2019 Google LLC 1263 * 1264 * Licensed under the Apache License, Version 2.0 (the "License"); 1265 * you may not use this file except in compliance with the License. 1266 * You may obtain a copy of the License at 1267 * 1268 * http://www.apache.org/licenses/LICENSE-2.0 1269 * 1270 * Unless required by applicable law or agreed to in writing, software 1271 * distributed under the License is distributed on an "AS IS" BASIS, 1272 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1273 * See the License for the specific language governing permissions and 1274 * limitations under the License. 1275 */async function gr(n,e,t=!1){const{auth:r}=n;if(_(r.app))return Promise.reject(w(r));const i="reauthenticate";try{const s=await H(n,pr(r,i,e,n),t);l(s.idToken,r,"internal-error");const o=Xe(s.idToken);l(o,r,"internal-error");const{sub:a}=o;return l(n.uid===a,r,"user-mismatch"),R._forOperation(n,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&b(r,"user-mismatch"),s}}/** 1276 * @license 1277 * Copyright 2020 Google LLC 1278 * 1279 * Licensed under the Apache License, Version 2.0 (the "License"); 1280 * you may not use this file except in compliance with the License. 1281 * You may obtain a copy of the License at 1282 * 1283 * http://www.apache.org/licenses/LICENSE-2.0 1284 * 1285 * Unless required by applicable law or agreed to in writing, software 1286 * distributed under the License is distributed on an "AS IS" BASIS, 1287 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1288 * See the License for the specific language governing permissions and 1289 * limitations under the License. 1290 */async function Ir(n,e,t=!1){if(_(n.app))return Promise.reject(w(n));const r="signIn",i=await pr(n,r,e),s=await R._fromIdTokenResponse(n,r,i);return t||await n._updateCurrentUser(s.user),s}async function et(n,e){return Ir(E(n),e)}async function _r(n,e){const t=p(n);return await Ze(!1,t,e.providerId),Ut(t,e)}async function Er(n,e){return gr(p(n),e)}/** 1291 * @license 1292 * Copyright 2020 Google LLC 1293 * 1294 * Licensed under the Apache License, Version 2.0 (the "License");
1295 * you may not use this file except in compliance with the License. 1296 * You may obtain a copy of the License at 1297 * 1298 * http://www.apache.org/licenses/LICENSE-2.0 1299 * 1300 * Unless required by applicable law or agreed to in writing, software 1301 * distributed under the License is distributed on an "AS IS" BASIS, 1302 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1303 * See the License for the specific language governing permissions and 1304 * limitations under the License. 1305 */async function qo(n,e){return B(n,"POST","/v1/accounts:signInWithCustomToken",g(n,e))}/** 1306 * @license 1307 * Copyright 2020 Google LLC 1308 * 1309 * Licensed under the Apache License, Version 2.0 (the "License"); 1310 * you may not use this file except in compliance with the License. 1311 * You may obtain a copy of the License at 1312 * 1313 * http://www.apache.org/licenses/LICENSE-2.0 1314 * 1315 * Unless required by applicable law or agreed to in writing, software 1316 * distributed under the License is distributed on an "AS IS" BASIS, 1317 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1318 * See the License for the specific language governing permissions and 1319 * limitations under the License. 1320 */async function Go(n,e){if(_(n.app))return Promise.reject(w(n));const t=E(n),r=await qo(t,{token:e,returnSecureToken:!0}),i=await R._fromIdTokenResponse(t,"signIn",r);return await t._updateCurrentUser(i.user),i}/** 1321 * @license 1322 * Copyright 2020 Google LLC 1323 * 1324 * Licensed under the Apache License, Version 2.0 (the "License"); 1325 * you may not use this file except in compliance with the License. 1326 * You may obtain a copy of the License at 1327 * 1328 * http://www.apache.org/licenses/LICENSE-2.0 1329 * 1330 * Unless required by applicable law or agreed to in writing, software 1331 * distributed under the License is distributed on an "AS IS" BASIS, 1332 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1333 * See the License for the specific language governing permissions and 1334 * limitations under the License. 1335 */class Le{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?Ft._fromServerResponse(e,t):"totpInfo"in t?Vt._fromServerResponse(e,t):b(e,"internal-error")}}class Ft extends Le{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new Ft(t)}}class Vt extends Le{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new Vt(t)}}/** 1336 * @license 1337 * Copyright 2020 Google LLC 1338 * 1339 * Licensed under the Apache License, Version 2.0 (the "License"); 1340 * you may not use this file except in compliance with the License. 1341 * You may obtain a copy of the License at 1342 * 1343 * http://www.apache.org/licenses/LICENSE-2.0 1344 * 1345 * Unless required by applicable law or agreed to in writing, software 1346 * distributed under the License is distributed on an "AS IS" BASIS, 1347 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1348 * See the License for the specific language governing permissions and 1349 * limitations under the License. 1350 */function tt(n,e,t){var r;l(((r=t.url)==null?void 0:r.length)>0,n,"invalid-continue-uri"),l(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),l(typeof t.linkDomain>"u"||t.linkDomain.length>0,n,"invalid-hosting-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.linkDomain=t.linkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(l(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(l(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}/** 1351 * @license 1352 * Copyright 2020 Google LLC 1353 * 1354 * Licensed under the Apache License, Version 2.0 (the "License"); 1355 * you may not use this file except in compliance with the License. 1356 * You may obtain a copy of the License at 1357 * 1358 * http://www.apache.org/licenses/LICENSE-2.0 1359 * 1360 * Unless required by applicable law or agreed to in writing, softw
1360are 1361 * distributed under the License is distributed on an "AS IS" BASIS, 1362 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1363 * See the License for the specific language governing permissions and 1364 * limitations under the License. 1365 */async function xt(n){const e=E(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function jo(n,e,t){const r=E(n),i={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};t&&tt(r,i,t),await G(r,i,"getOobCode",Po,"EMAIL_PASSWORD_PROVIDER")}async function Ko(n,e,t){await hr(p(n),{oobCode:e,newPassword:t}).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&xt(n),r})}async function Yo(n,e){await bo(p(n),{oobCode:e})}async function yr(n,e){const t=p(n),r=await hr(t,{oobCode:e}),i=r.requestType;switch(l(i,t,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":l(r.newEmail,t,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":l(r.mfaInfo,t,"internal-error");default:l(r.email,t,"internal-error")}let s=null;return r.mfaInfo&&(s=Le._fromServerResponse(E(t),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 Jo(n,e){const{data:t}=await yr(p(n),e);return t.email}async function Xo(n,e,t){if(_(n.app))return Promise.reject(w(n));const r=E(n),o=await G(r,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",fr,"EMAIL_PASSWORD_PROVIDER").catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&xt(n),c}),a=await R._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(a.user),a}function Qo(n,e,t){return _(n.app)?Promise.reject(w(n)):et(p(n),Y.credential(e,t)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&xt(n),r})}/** 1366 * @license 1367 * Copyright 2020 Google LLC 1368 * 1369 * Licensed under the Apache License, Version 2.0 (the "License"); 1370 * you may not use this file except in compliance with the License. 1371 * You may obtain a copy of the License at 1372 * 1373 * http://www.apache.org/licenses/LICENSE-2.0 1374 * 1375 * Unless required by applicable law or agreed to in writing, software 1376 * distributed under the License is distributed on an "AS IS" BASIS, 1377 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1378 * See the License for the specific language governing permissions and 1379 * limitations under the License. 1380 */async function Zo(n,e,t){const r=E(n),i={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function s(o,a){l(a.handleCodeInApp,r,"argument-error"),a&&tt(r,o,a)}s(i,t),await G(r,i,"getOobCode",Co,"EMAIL_PASSWORD_PROVIDER")}function ea(n,e){const t=de.parseLink(e);return(t==null?void 0:t.operation)==="EMAIL_SIGNIN"}async function ta(n,e,t){if(_(n.app))return Promise.reject(w(n));const r=p(n),i=Y.credentialWithLink(e,t||Se());return l(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),et(r,i)}/** 1381 * @license 1382 * Copyright 2020 Google LLC 1383 * 1384 * Licensed under the Apache License, Version 2.0 (the "License"); 1385 * you may not use this file except in compliance with the License. 1386 * You may obtain a copy of the License at 1387 * 1388 * http://www.apache.org/licenses/LICENSE-2.0 1389 * 1390 * Unless required by applicable law or agreed to in writing, software 1391 * distributed under the License is distributed on an "AS IS" BASIS, 1392 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1393 * See the License for the specific language governing permissions and 1394 * limitations under the License. 1395 */async function na(n,e){return I(n,"POST","/v1/accounts:createAuthUri",g(n,e))}/** 1396 * @license 1397 * Copyright 2020 Google LLC 1398 * 1399 * Licensed under the Apache License, Version 2.0 (the "License"); 1400 * you may not use this file except in compliance with the License. 1401 * You may obtain a copy of the License at 1402 * 1403 * http://www.apache.org/licenses/LICENSE-2.0 1404 * 1405 * Unless required by applicable law or agreed to in writing, software 1406 * distributed under the License is distributed on an "AS IS" BASIS, 1407 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1408 * See the License for the specific language governing permissions and 1409 * limitations under the License. 1410 */async function ra(n,e){const t=Ot()?Se():"http://localhost",r={identifier:e,continueUri:t},{signinMethods:i}=await na(p(n),r);return i||[]}async function ia(n,e){const t=p(n),i={requestType:"VERIFY_EMAIL",idToken:await n.getIdToken()};e&&tt(t.auth,i,e);const{email:s}=await Ro(t.auth,i);s!==n.email&&await n.reload()}async function sa(n,e,t){const r=p(n),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await n.getIdToken(),newEmail:e};t&&tt(r.auth,s,t);const{email:o}=await ko(r.auth,s);o!==n.email&&await n.reload()}/** 1411 * @license 1412 * Copyright 2020 Google LLC 1413 * 1414 * Licensed under the Apache License, Version 2.0 (the "License");
1415 * you may not use this file except in compliance with the License. 1416 * You may obtain a copy of the License at 1417 * 1418 * http://www.apache.org/licenses/LICENSE-2.0 1419 * 1420 * Unless required by applicable law or agreed to in writing, software 1421 * distributed under the License is distributed on an "AS IS" BASIS, 1422 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1423 * See the License for the specific language governing permissions and 1424 * limitations under the License. 1425 */async function oa(n,e){return I(n,"POST","/v1/accounts:update",e)}/** 1426 * @license 1427 * Copyright 2020 Google LLC 1428 * 1429 * Licensed under the Apache License, Version 2.0 (the "License"); 1430 * you may not use this file except in compliance with the License. 1431 * You may obtain a copy of the License at 1432 * 1433 * http://www.apache.org/licenses/LICENSE-2.0 1434 * 1435 * Unless required by applicable law or agreed to in writing, software 1436 * distributed under the License is distributed on an "AS IS" BASIS, 1437 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1438 * See the License for the specific language governing permissions and 1439 * limitations under the License. 1440 */async function aa(n,{displayName:e,photoURL:t}){if(e===void 0&&t===void 0)return;const r=p(n),s={idToken:await r.getIdToken(),displayName:e,photoUrl:t,returnSecureToken:!0},o=await H(r,oa(r.auth,s));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:c})=>c==="password");a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}function ca(n,e){const t=p(n);return _(t.auth.app)?Promise.reject(w(t.auth)):Tr(t,e,null)}function ua(n,e){return Tr(p(n),null,e)}async function Tr(n,e,t){const{auth:r}=n,s={idToken:await n.getIdToken(),returnSecureToken:!0};e&&(s.email=e),t&&(s.password=t);const o=await H(n,vo(r,s));await n._updateTokensIfNecessary(o,!0)}/** 1441 * @license 1442 * Copyright 2019 Google LLC 1443 * 1444 * Licensed under the Apache License, Version 2.0 (the "License"); 1445 * you may not use this file except in compliance with the License. 1446 * You may obtain a copy of the License at 1447 * 1448 * http://www.apache.org/licenses/LICENSE-2.0 1449 * 1450 * Unless required by applicable law or agreed to in writing, software 1451 * distributed under the License is distributed on an "AS IS" BASIS, 1452 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1453 * See the License for the specific language governing permissions and 1454 * limitations under the License. 1455 */function la(n){var i,s;if(!n)return null;const{providerId:e}=n,t=n.rawUserInfo?JSON.parse(n.rawUserInfo):{},r=n.isNewUser||n.kind==="identitytoolkit#SignupNewUserResponse";if(!e&&(n!=null&&n.idToken)){const o=(s=(i=Xe(n.idToken))==null?void 0:i.firebase)==null?void 0:s.sign_in_provider;if(o){const a=o!=="anonymous"&&o!=="custom"?o:null;return new ie(r,a)}}if(!e)return null;switch(e){case"facebook.com":return new da(r,t);case"github.com":return new ha(r,t);case"google.com":return new fa(r,t);case"twitter.com":return new pa(r,t,n.screenName||null);case"custom":case"anonymous":return new ie(r,null);default:return new ie(r,e,t)}}class ie{constructor(e,t,r={}){this.isNewUser=e,this.providerId=t,this.profile=r}}
1455class wr extends ie{constructor(e,t,r,i){super(e,t,r),this.username=i}}class da extends ie{constructor(e,t){super(e,"facebook.com",t)}}class ha extends wr{constructor(e,t){super(e,"github.com",t,typeof(t==null?void 0:t.login)=="string"?t==null?void 0:t.login:null)}}class fa extends ie{constructor(e,t){super(e,"google.com",t)}}class pa extends wr{constructor(e,t,r){super(e,"twitter.com",t,r)}}function ma(n){const{user:e,_tokenResponse:t}=n;return e.isAnonymous&&!t?{providerId:null,isNewUser:!1,profile:null}:la(t)}/** 1456 * @license 1457 * Copyright 2020 Google LLC 1458 * 1459 * Licensed under the Apache License, Version 2.0 (the "License"); 1460 * you may not use this file except in compliance with the License. 1461 * You may obtain a copy of the License at 1462 * 1463 * http://www.apache.org/licenses/LICENSE-2.0 1464 * 1465 * Unless required by applicable law or agreed to in writing, software 1466 * distributed under the License is distributed on an "AS IS" BASIS, 1467 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1468 * See the License for the specific language governing permissions and 1469 * limitations under the License. 1470 */function ga(n,e){return p(n).setPersistence(e)}function Ia(n){return cr(n)}async function _a(n,e){return E(n).validatePassword(e)}function vr(n,e,t,r){return p(n).onIdTokenChanged(e,t,r)}function Ar(n,e,t){return p(n).beforeAuthStateChanged(e,t)}function Ea(n,e,t,r){return p(n).onAuthStateChanged(e,t,r)}function ya(n){p(n).useDeviceLanguage()}function Ta(n,e){return p(n).updateCurrentUser(e)}function wa(n){return p(n).signOut()}function va(n,e){return E(n).revokeAccessToken(e)}async function Aa(n){return p(n).delete()}/** 1471 * @license 1472 * Copyright 2020 Google LLC 1473 * 1474 * Licensed under the Apache License, Version 2.0 (the "License"); 1475 * you may not use this file except in compliance with the License. 1476 * You may obtain a copy of the License at 1477 * 1478 * http://www.apache.org/licenses/LICENSE-2.0 1479 * 1480 * Unless required by applicable law or agreed to in writing, software 1481 * distributed under the License is distributed on an "AS IS" BASIS, 1482 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1483 * See the License for the specific language governing permissions and 1484 * limitations under the License. 1485 */class X{constructor(e,t,r){this.type=e,this.credential=t,this.user=r}static _fromIdtoken(e,t){return new X("enroll",e,t)}static _fromMfaPendingCredential(e){return new X("signin",e)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,r;if(e!=null&&e.multiFactorSession){if((t=e.multiFactorSession)!=null&&t.pendingCredential)return X._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if((r=e.multiFactorSession)!=null&&r.idToken)return X._fromIdtoken(e.multiFactorSession.idToken)}return null}}/** 1486 * @license 1487 * Copyright 2020 Google LLC 1488 * 1489 * Licensed under the Apache License, Version 2.0 (the "License"); 1490 * you may not use this file except in compliance with the License. 1491 * You may obtain a copy of the License at 1492 * 1493 * http://www.apache.org/licenses/LICENSE-2.0 1494 * 1495 * Unless required by applicable law or agreed to in writing, software 1496 * distributed under the License is distributed on an "AS IS" BASIS, 1497 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1498 * See the License for the specific language governing permissions and 1499 * limitations under the License. 1500 */class Ht{constructor(e,t,r){this.session=e,this.hints=t,this.signInResolver=r}static _fromError(e,t){const r=E(e),i=t.customData._serverResponse,s=(i.mfaInfo||[]).map(a=>Le._fromServerResponse(r,a));l(i.mfaPendingCredential,r,"internal-error");const o=X._fromMfaPendingCredential(i.mfaPendingCredential);return new Ht(o,s,async a=>{const c=await a._process(r,o);delete i.mfaInfo,delete i.mfaPendingCredential;const u={...i,idToken:c.idToken,refreshToken:c.refreshToken};switch(t.operationType){case"signIn":const h=await R._fromIdTokenResponse(r,t.operationType,u);return await r._updateCurrentUser(h.user),h;case"reauthenticate":return l(t.user,r,"internal-error"),R._forOperation(t.user,t.operationType,u);default:b(r,"internal-error")}})}async resolveSignIn(e){const t=e;return this.signInResolver(t)}}function ba(n,e){var i;const t=p(n),r=e;return l(e.customData.operationType,t,"argument-error"),l((i=r.customData._serverResponse)==null?void 0:i.mfaPendingCredential,t,"argument-error"),Ht._fromError(t,r)}/** 1501 * @license 1502 * Copyright 2020 Google LLC 1503 * 1504 * Licensed under the Apache License, Version 2.0 (the "License");
1505 * you may not use this file except in compliance with the License. 1506 * You may obtain a copy of the License at 1507 * 1508 * http://www.apache.org/licenses/LICENSE-2.0 1509 * 1510 * Unless required by applicable law or agreed to in writing, software 1511 * distributed under the License is distributed on an "AS IS" BASIS, 1512 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1513 * See the License for the specific language governing permissions and 1514 * limitations under the License. 1515 */function gn(n,e){return I(n,"POST","/v2/accounts/mfaEnrollment:start",g(n,e))}function Sa(n,e){return I(n,"POST","/v2/accounts/mfaEnrollment:finalize",g(n,e))}function Ra(n,e){return I(n,"POST","/v2/accounts/mfaEnrollment:start",g(n,e))}function Pa(n,e){return I(n,"POST","/v2/accounts/mfaEnrollment:finalize",g(n,e))}function Ca(n,e){return I(n,"POST","/v2/accounts/mfaEnrollment:withdraw",g(n,e))}class Bt{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(r=>Le._fromServerResponse(e.auth,r)))})}static _fromUser(e){return new Bt(e)}async getSession(){return X._fromIdtoken(await this.user.getIdToken(),this.user)}
1515async enroll(e,t){const r=e,i=await this.getSession(),s=await H(this.user,r._process(this.user.auth,i,t));return await this.user._updateTokensIfNecessary(s),this.user.reload()}async unenroll(e){const t=typeof e=="string"?e:e.uid,r=await this.user.getIdToken();try{const i=await H(this.user,Ca(this.user.auth,{idToken:r,mfaEnrollmentId:t}));this.enrolledFactors=this.enrolledFactors.filter(({uid:s})=>s!==t),await this.user._updateTokensIfNecessary(i),await this.user.reload()}catch(i){throw i}}}const pt=new WeakMap;function ka(n){const e=p(n);return pt.has(e)||pt.set(e,Bt._fromUser(e)),pt.get(e)}const Ke="__sak";/** 1516 * @license 1517 * Copyright 2019 Google LLC 1518 * 1519 * Licensed under the Apache License, Version 2.0 (the "License"); 1520 * you may not use this file except in compliance with the License. 1521 * You may obtain a copy of the License at 1522 * 1523 * http://www.apache.org/licenses/LICENSE-2.0 1524 * 1525 * Unless required by applicable law or agreed to in writing, software 1526 * distributed under the License is distributed on an "AS IS" BASIS, 1527 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1528 * See the License for the specific language governing permissions and 1529 * limitations under the License. 1530 */class br{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Ke,"1"),this.storage.removeItem(Ke),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** 1531 * @license 1532 * Copyright 2020 Google LLC 1533 * 1534 * Licensed under the Apache License, Version 2.0 (the "License"); 1535 * you may not use this file except in compliance with the License. 1536 * You may obtain a copy of the License at 1537 * 1538 * http://www.apache.org/licenses/LICENSE-2.0 1539 * 1540 * Unless required by applicable law or agreed to in writing, software 1541 * distributed under the License is distributed on an "AS IS" BASIS, 1542 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1543 * See the License for the specific language governing permissions and 1544 * limitations under the License. 1545 */const Na=1e3,Oa=10;class Sr extends br{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=ir(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;t?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);to()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Oa):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},Na)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){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(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1545ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Sr.type="LOCAL";const Rr=Sr;/** 1546 * @license 1547 * Copyright 2025 Google LLC 1548 * 1549 * Licensed under the Apache License, Version 2.0 (the "License"); 1550 * you may not use this file except in compliance with the License. 1551 * You may obtain a copy of the License at 1552 * 1553 * http://www.apache.org/licenses/LICENSE-2.0 1554 * 1555 * Unless required by applicable law or agreed to in writing, software 1556 * distributed under the License is distributed on an "AS IS" BASIS, 1557 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1558 * See the License for the specific language governing permissions and 1559 * limitations under the License. 1560 */const Da=1e3;function mt(n){var r;const e=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),t=RegExp(`${e}=([^;]+)`);return((r=document.cookie.match(t))==null?void 0:r[1])??null}function gt(n){return`${window.location.protocol==="http:"?"__dev_":"__HOST-"}FIREBASE_${n.split(":")[3]}`}class Pr{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){if(typeof window===void 0)return e;const t=new URL(`${window.location.origin}/__cookies__`);return t.searchParams.set("finalTarget",e),t}async _isAvailable(){return typeof isSecureContext=="boolean"&&!isSecureContext||typeof navigator>"u"||typeof document>"u"?!1:navigator.cookieEnabled??!0}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;const t=gt(e);if(window.cookieStore){const r=await window.cookieStore.get(t);return r==null?void 0:r.value}return mt(t)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;const r=gt(e);document.cookie=`${r}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch("/__cookies__",{method:"DELETE"}).catch(()=>{})}_addListener(e,t){if(!this._isAvailable())return;const r=gt(e);if(window.cookieStore){const a=u=>{const h=u.changed.find(d=>d.name===r);h&&t(h.value),u.deleted.find(d=>d.name===r)&&t(null)},c=()=>window.cookieStore.removeEventListener("change",a);return this.listenerUnsubscribes.set(t,c),window.cookieStore.addEventListener("change",a)}let i=mt(r);const s=setInterval(()=>{const a=mt(r);a!==i&&(t(a),i=a)},Da),o=()=>clearInterval(s);this.listenerUnsubscribes.set(t,o)}_removeListener(e,t){const r=this.listenerUnsubscribes.get(t);r&&(r(),this.listenerUnsubscribes.delete(t))}}Pr.type="COOKIE";const La=Pr;/** 1561 * @license 1562 * Copyright 2020 Google LLC 1563 * 1564 * Licensed under the Apache License, Version 2.0 (the "License"); 1565 * you may not use this file except in compliance with the License. 1566 * You may obtain a copy of the License at 1567 * 1568 * http://www.apache.org/licenses/LICENSE-2.0 1569 * 1570 * Unless required by applicable law or agreed to in writing, software 1571 * distributed under the License is distributed on an "AS IS" BASIS, 1572 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1573 * See the License for the specific language governing permissions and 1574 * limitations under the License. 1575 */class Cr extends br{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Cr.type="SESSION";const Wt=Cr;/** 1576 * @license 1577 * Copyright 2019 Google LLC 1578 * 1579 * Licensed under the Apache License, Version 2.0 (the "License"); 1580 * you may not use this file except in compliance with the License. 1581 * You may obtain a copy of the License at 1582 * 1583 * http://www.apache.org/licenses/LICENSE-2.0 1584 * 1585 * Unless required by applicable law or agreed to in writing, software 1586 * distributed under the License is distributed on an "AS IS" BASIS, 1587 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1588 * See the License for the specific language governing permissions and 1589 * limitations under the License. 1590 */function Ma(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/** 1591 * @license 1592 * Copyright 2019 Google LLC 1593 * 1594 * Licensed under the Apache License, Version 2.0 (the "License");
1595 * you may not use this file except in compliance with the License. 1596 * You may obtain a copy of the License at 1597 * 1598 * http://www.apache.org/licenses/LICENSE-2.0 1599 * 1600 * Unless required by applicable law or agreed to in writing, software 1601 * distributed under the License is distributed on an "AS IS" BASIS, 1602 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1603 * See the License for the specific language governing permissions and 1604 * limitations under the License. 1605 */class nt{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(i=>i.isListeningto(e));if(t)return t;const r=new nt(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:i,data:s}=t.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async u=>u(t.origin,s)),c=await Ma(a);t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}nt.receivers=[];/** 1606 * @license 1607 * Copyright 2020 Google LLC 1608 * 1609 * Licensed under the Apache License, Version 2.0 (the "License"); 1610 * you may not use this file except in compliance with the License. 1611 * You may obtain a copy of the License at 1612 * 1613 * http://www.apache.org/licenses/LICENSE-2.0 1614 * 1615 * Unless required by applicable law or agreed to in writing, software 1616 * distributed under the License is distributed on an "AS IS" BASIS, 1617 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1618 * See the License for the specific language governing permissions and 1619 * limitations under the License. 1620 */function rt(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}/** 1621 * @license 1622 * Copyright 2019 Google LLC 1623 * 1624 * Licensed under the Apache License, Version 2.0 (the "License"); 1625 * you may not use this file except in compliance with the License. 1626 * You may obtain a copy of the License at 1627 * 1628 * http://www.apache.org/licenses/LICENSE-2.0 1629 * 1630 * Unless required by applicable law or agreed to in writing, software 1631 * distributed under the License is distributed on an "AS IS" BASIS, 1632 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1633 * See the License for the specific language governing permissions and 1634 * limitations under the License. 1635 */class Ua{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((a,c)=>{const u=rt("",20);i.port1.start();const h=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const d=f;if(d.data.eventId===u)switch(d.data.status){case"ack":clearTimeout(h),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(d.data.response);break;default:clearTimeout(h),clearTimeout(s),c(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:u,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/** 1636 * @license 1637 * Copyright 2020 Google LLC 1638 * 1639 * Licensed under the Apache License, Version 2.0 (the "License"); 1640 * you may not use this file except in compliance with the License. 1641 * You may obtain a copy of the License at 1642 * 1643 * http://www.apache.org/licenses/LICENSE-2.0 1644 * 1645 * Unless required by applicable law or agreed to in writing, softw
1645are 1646 * distributed under the License is distributed on an "AS IS" BASIS, 1647 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1648 * See the License for the specific language governing permissions and 1649 * limitations under the License. 1650 */function y(){return window}function Fa(n){y().location.href=n}/** 1651 * @license 1652 * Copyright 2020 Google LLC. 1653 * 1654 * Licensed under the Apache License, Version 2.0 (the "License"); 1655 * you may not use this file except in compliance with the License. 1656 * You may obtain a copy of the License at 1657 * 1658 * http://www.apache.org/licenses/LICENSE-2.0 1659 * 1660 * Unless required by applicable law or agreed to in writing, software 1661 * distributed under the License is distributed on an "AS IS" BASIS, 1662 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1663 * See the License for the specific language governing permissions and 1664 * limitations under the License. 1665 */function $t(){return typeof y().WorkerGlobalScope<"u"&&typeof y().importScripts=="function"}async function Va(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function xa(){var n;return((n=navigator==null?void 0:navigator.serviceWorker)==null?void 0:n.controller)||null}function Ha(){return $t()?self:null}/** 1666 * @license 1667 * Copyright 2019 Google LLC 1668 * 1669 * Licensed under the Apache License, Version 2.0 (the "License"); 1670 * you may not use this file except in compliance with the License. 1671 * You may obtain a copy of the License at 1672 * 1673 * http://www.apache.org/licenses/LICENSE-2.0 1674 * 1675 * Unless required by applicable law or agreed to in writing, software 1676 * distributed under the License is distributed on an "AS IS" BASIS, 1677 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1678 * See the License for the specific language governing permissions and 1679 * limitations under the License. 1680 */const kr="firebaseLocalStorageDb",Ba=1,Ye="firebaseLocalStorage",Nr="fbase_key";class Me{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function it(n,e){return n.transaction([Ye],e?"readwrite":"readonly").objectStore(Ye)}function Wa(){const n=indexedDB.deleteDatabase(kr);return new Me(n).toPromise()}function Rt(){const n=indexedDB.open(kr,Ba);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Ye,{keyPath:Nr})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Ye)?e(r):(r.close(),await Wa(),e(await Rt()))})})}async function In(n,e,t){const r=it(n,!0).put({[Nr]:e,value:t});return new Me(r).toPromise()}async function $a(n,e){const t=it(n,!1).get(e),r=await new Me(t).toPromise();return r===void 0?null:r.value}function _n(n,e){const t=it(n,!0).delete(e);return new Me(t).toPromise()}const za=800,qa=3;class Or{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Rt(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>qa)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return $t()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=nt._getInstance(Ha()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var t,r;if(this.activeServiceWorker=await Va(),!this.activeServiceWorker)return;this.sender=new Ua(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(t=e[0])!=null&&t.fulfilled&&(r=e[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||xa()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Rt();return await In(e,Ke,"1"),await _n(e,Ke),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>In(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>$a(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>_n(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=it(i,!1).getAll();return new Me(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),za)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1680ject.keys(this.listeners).length===0&&this.stopPolling()}}Or.type="LOCAL";const Dr=Or;/** 1681 * @license 1682 * Copyright 2020 Google LLC 1683 * 1684 * Licensed under the Apache License, Version 2.0 (the "License"); 1685 * you may not use this file except in compliance with the License. 1686 * You may obtain a copy of the License at 1687 * 1688 * http://www.apache.org/licenses/LICENSE-2.0 1689 * 1690 * Unless required by applicable law or agreed to in writing, software 1691 * distributed under the License is distributed on an "AS IS" BASIS, 1692 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1693 * See the License for the specific language governing permissions and 1694 * limitations under the License. 1695 */function En(n,e){return I(n,"POST","/v2/accounts/mfaSignIn:start",g(n,e))}function Ga(n,e){return I(n,"POST","/v2/accounts/mfaSignIn:finalize",g(n,e))}function ja(n,e){return I(n,"POST","/v2/accounts/mfaSignIn:finalize",g(n,e))}/** 1696 * @license 1697 * Copyright 2020 Google LLC 1698 * 1699 * Licensed under the Apache License, Version 2.0 (the "License"); 1700 * you may not use this file except in compliance with the License. 1701 * You may obtain a copy of the License at 1702 * 1703 * http://www.apache.org/licenses/LICENSE-2.0 1704 * 1705 * Unless required by applicable law or agreed to in writing, software 1706 * distributed under the License is distributed on an "AS IS" BASIS, 1707 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1708 * See the License for the specific language governing permissions and 1709 * limitations under the License. 1710 */const It=or("rcb"),Ka=new Oe(3e4,6e4);class Ya{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!((e=y().grecaptcha)!=null&&e.render)}load(e,t=""){return l(Ja(t),e,"argument-error"),this.shouldResolveImmediately(t)&&an(y().grecaptcha)?Promise.resolve(y().grecaptcha):new Promise((r,i)=>{const s=y().setTimeout(()=>{i(v(e,"network-request-failed"))},Ka.get());y()[It]=()=>{y().clearTimeout(s),delete y()[It];const a=y().grecaptcha;if(!a||!an(a)){i(v(e,"internal-error"));return}const c=a.render;a.render=(u,h)=>{const f=c(u,h);return this.counter++,f},this.hostLanguage=t,r(a)};const o=`${co()}?${ce({onload:It,render:"explicit",hl:t})}`;Mt(o).catch(()=>{clearTimeout(s),i(v(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!!((t=y().grecaptcha)!=null&&t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}function Ja(n){return n.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(n)}class Xa{async load(e){return new po(e)}clearedOneInstance(){}}/** 1711 * @license 1712 * Copyright 2020 Google LLC 1713 * 1714 * Licensed under the Apache License, Version 2.0 (the "License"); 1715 * you may not use this file except in compliance with the License. 1716 * You may obtain a copy of the License at 1717 * 1718 * http://www.apache.org/licenses/LICENSE-2.0 1719 * 1720 * Unless required by applicable law or agreed to in writing, software 1721 * distributed under the License is distributed on an "AS IS" BASIS, 1722 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1723 * See the License for the specific language governing permissions and 1724 * limitations under the License. 1725 */const ve="recaptcha",Qa={theme:"light",type:"image"};class Za{constructor(e,t,r={...Qa}){this.parameters=r,this.type=ve,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",l(typeof document<"u",this.auth,"operation-not-supported-in-this-environment");const i=typeof t=="string"?document.getElementById(t):t;l(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Xa:new Ya,this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),t=this.getAssertedRecaptcha(),r=t.getResponse(e);return r||new Promise(i=>{const s=o=>{o&&(this.tokenChangeListeners.delete(s),i(o))};this.tokenChangeListeners.add(s),this.isInvisible&&t.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.forEac
1725h(e=>{this.container.removeChild(e)})}validateStartingState(){l(!this.parameters.sitekey,this.auth,"argument-error"),l(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),l(typeof document<"u",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(r=>r(t)),typeof e=="function")e(t);else if(typeof e=="string"){const r=y()[e];typeof r=="function"&&r(t)}}}assertNotDestroyed(){l(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){const t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){l(Ot()&&!$t(),this.auth,"internal-error"),await ec(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const e=await qs(this.auth);l(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return l(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}function ec(){let n=null;return new Promise(e=>{if(document.readyState==="complete"){e();return}n=()=>e(),window.addEventListener("load",n)}).catch(e=>{throw n&&window.removeEventListener("load",n),e})}/** 1726 * @license 1727 * Copyright 2020 Google LLC 1728 * 1729 * Licensed under the Apache License, Version 2.0 (the "License"); 1730 * you may not use this file except in compliance with the License. 1731 * You may obtain a copy of the License at 1732 * 1733 * http://www.apache.org/licenses/LICENSE-2.0 1734 * 1735 * Unless required by applicable law or agreed to in writing, software 1736 * distributed under the License is distributed on an "AS IS" BASIS, 1737 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1738 * See the License for the specific language governing permissions and 1739 * limitations under the License. 1740 */class zt{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){const t=j._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function tc(n,e,t){if(_(n.app))return Promise.reject(w(n));const r=E(n),i=await st(r,e,p(t));return new zt(i,s=>et(r,s))}async function nc(n,e,t){const r=p(n);await Ze(!1,r,"phone");const i=await st(r.auth,e,p(t));return new zt(i,s=>_r(r,s))}async function rc(n,e,t){const r=p(n);if(_(r.auth.app))return Promise.reject(w(r.auth));const i=await st(r.auth,e,p(t));return new zt(i,s=>Er(r,s))}async function st(n,e,t){var r;if(!n._getRecaptchaConfig())try{await cr(n)}catch{console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let i;if(typeof e=="string"?i={phoneNumber:e}:i=e,"session"in i){const s=i.session;if("phoneNumber"in i){l(s.type==="enroll",n,"internal-error");const o={idToken:s.credential,phoneEnrollmentInfo:{phoneNumber:i.phoneNumber,clientType:"CLIENT_TYPE_WEB"}};return(await G(n,o,"mfaSmsEnrollment",async(h,f)=>{if(f.phoneEnrollmentInfo.captchaResponse===Te){l((t==null?void 0:t.type)===ve,h,"argument-error");const d=await _t(h,f,t);return gn(h,d)}return gn(h,f)},"PHONE_PROVIDER").catch(h=>Promise.reject(h))).phoneSessionInfo.sessionInfo}else{l(s.type==="signin",n,"internal-error");const o=((r=i.multiFactorHint)==null?void 0:r.uid)||i.multiFactorUid;l(o,n,"missing-multi-factor-info");const a={mfaPendingCredential:s.credential,mfaEnrollmentId:o,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}};return(await G(n,a,"mfaSmsSignIn",async(f,d)=>{if(d.phoneSignInInfo.captchaResponse===Te){l((t==null?void 0:t.type)===ve,f,"argument-error");const T=await _t(f,d,t);return En(f,T)}return En(f,d)},"PHONE_PROVIDER").catch(f=>Promise.reject(f))).phoneResponseInfo.sessionInfo}}else{const s={phoneNumber:i.phoneNumber,clientType:"CLIENT_TYPE_WEB"};return(await G(n,s,"sendVerificationCode",async(u,h)=>{if(h.captchaResponse===Te){l((t==null?void 0:t.type)===ve,u,"argument-error");const f=await _t(u,h,t);return pn(u,f)}return pn(u,h)},"PHONE_PROVIDER").catch(u=>Promise.reject(u))).sessionInfo}}finally{t==null||t._reset()}}async function ic(n,e){const t=p(n);if(_(t.auth.app))return Promise.reject(w(t.auth));await Ut(t,e)}async function _t(n,e,t){l(t.type===ve,n,"argument-error");const r=await t.verify();l(typeof r=="string",n,"argument-error");const i={...e};if("phoneEnrollmentInfo"in i){const s=i.phoneEnrollmentInfo.phoneNumber,o=i.phoneEnrollmentInfo.captchaResponse,a=i.phoneEnrollmentInfo.clientType,c=i.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(i,{phoneEnrollmentInfo:{phoneNumber:s,recaptchaToken:r,captchaResponse:o,clientType:a,recaptchaVersion:c}}),i}else if("phoneSignInInfo"in i){const s=i.phoneSignInInfo.captchaResponse,o=i.phoneSignInInfo.clientType,a=i.phoneSignInInfo.recaptchaVersion;return Object.assign(i,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:s,clientType:o,recaptchaVersion:a}}),i}else return Object.assign(i,{recaptchaToken:r}),i}/** 1741 * @license 1742 * Copyright 2020 Google LLC 1743 * 1744 * Licensed under the Apache License, Version 2.0 (the "License");
1745 * you may not use this file except in compliance with the License. 1746 * You may obtain a copy of the License at 1747 * 1748 * http://www.apache.org/licenses/LICENSE-2.0 1749 * 1750 * Unless required by applicable law or agreed to in writing, software 1751 * distributed under the License is distributed on an "AS IS" BASIS, 1752 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1753 * See the License for the specific language governing permissions and 1754 * limitations under the License. 1755 */class Q{constructor(e){this.providerId=Q.PROVIDER_ID,this.auth=E(e)}verifyPhoneNumber(e,t){return st(this.auth,e,p(t))}static credential(e,t){return j._fromVerification(e,t)}static credentialFromResult(e){const t=e;return Q.credentialFromTaggedObject(t)}static credentialFromError(e){return Q.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:r}=e;return t&&r?j._fromTokenResponse(t,r):null}}Q.PROVIDER_ID="phone";Q.PHONE_SIGN_IN_METHOD="phone";/** 1756 * @license 1757 * Copyright 2021 Google LLC 1758 * 1759 * Licensed under the Apache License, Version 2.0 (the "License"); 1760 * you may not use this file except in compliance with the License. 1761 * You may obtain a copy of the License at 1762 * 1763 * http://www.apache.org/licenses/LICENSE-2.0 1764 * 1765 * Unless required by applicable law or agreed to in writing, software 1766 * distributed under the License is distributed on an "AS IS" BASIS, 1767 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1768 * See the License for the specific language governing permissions and 1769 * limitations under the License. 1770 */function Z(n,e){return e?M(e):(l(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/** 1771 * @license 1772 * Copyright 2019 Google LLC 1773 * 1774 * Licensed under the Apache License, Version 2.0 (the "License"); 1775 * you may not use this file except in compliance with the License. 1776 * You may obtain a copy of the License at 1777 * 1778 * http://www.apache.org/licenses/LICENSE-2.0 1779 * 1780 * Unless required by applicable law or agreed to in writing, software 1781 * distributed under the License is distributed on an "AS IS" BASIS, 1782 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1783 * See the License for the specific language governing permissions and 1784 * limitations under the License. 1785 */class qt extends le{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return F(e,this._buildIdpRequest())}_linkToIdToken(e,t){return F(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return F(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function sc(n){return Ir(n.auth,new qt(n),n.bypassAuthState)}function oc(n){const{auth:e,user:t}=n;return l(t,e,"internal-error"),gr(t,new qt(n),n.bypassAuthState)}async function ac(n){const{auth:e,user:t}=n;return l(t,e,"internal-error"),Ut(t,new qt(n),n.bypassAuthState)}/** 1786 * @license 1787 * Copyright 2020 Google LLC 1788 * 1789 * Licensed under the Apache License, Version 2.0 (the "License"); 1790 * you may not use this file except in compliance with the License. 1791 * You may obtain a copy of the License at 1792 * 1793 * http://www.apache.org/licenses/LICENSE-2.0 1794 * 1795 * Unless required by applicable law or agreed to in writing, software 1796 * distributed under the License is distributed on an "AS IS" BASIS, 1797 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1798 * See the License for the specific language governing permissions and 1799 * limitations under the License. 1800 */class Lr{constructor(e,t,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(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:t,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(u){this.reject(u)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return sc;case"linkViaPopup":case"linkViaRedirect":return ac;case"reauthViaPopup":case"reauthViaRedirect":return oc;default:b(this.auth,"internal-error")}}resolve(e){x(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){x(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()}}/** 1801 * @license 1802 * Copyright 2020 Google LLC 1803 * 1804 * Licensed under the Apache License, Version 2.0 (the "License");
1805 * you may not use this file except in compliance with the License. 1806 * You may obtain a copy of the License at 1807 * 1808 * http://www.apache.org/licenses/LICENSE-2.0 1809 * 1810 * Unless required by applicable law or agreed to in writing, software 1811 * distributed under the License is distributed on an "AS IS" BASIS, 1812 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1813 * See the License for the specific language governing permissions and 1814 * limitations under the License. 1815 */const cc=new Oe(2e3,1e4);async function uc(n,e,t){if(_(n.app))return Promise.reject(v(n,"operation-not-supported-in-this-environment"));const r=E(n);ue(n,e,W);const i=Z(r,t);return new U(r,"signInViaPopup",e,i).executeNotNull()}async function lc(n,e,t){const r=p(n);if(_(r.auth.app))return Promise.reject(v(r.auth,"operation-not-supported-in-this-environment"));ue(r.auth,e,W);const i=Z(r.auth,t);return new U(r.auth,"reauthViaPopup",e,i,r).executeNotNull()}async function dc(n,e,t){const r=p(n);ue(r.auth,e,W);const i=Z(r.auth,t);return new U(r.auth,"linkViaPopup",e,i,r).executeNotNull()}class U extends Lr{constructor(e,t,r,i,s){super(e,t,i,s),this.provider=r,this.authWindow=null,this.pollId=null,U.currentPopupAction&&U.currentPopupAction.cancel(),U.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return l(e,this.auth,"internal-error"),e}async onExecution(){x(this.filter.length===1,"Popup operations only handle one event");const e=rt();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(v(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(v(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,U.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if((r=(t=this.authWindow)==null?void 0:t.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(v(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,cc.get())};e()}}U.currentPopupAction=null;/** 1816 * @license 1817 * Copyright 2020 Google LLC 1818 * 1819 * Licensed under the Apache License, Version 2.0 (the "License"); 1820 * you may not use this file except in compliance with the License. 1821 * You may obtain a copy of the License at 1822 * 1823 * http://www.apache.org/licenses/LICENSE-2.0 1824 * 1825 * Unless required by applicable law or agreed to in writing, software 1826 * distributed under the License is distributed on an "AS IS" BASIS, 1827 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1828 * See the License for the specific language governing permissions and 1829 * limitations under the License. 1830 */const hc="pendingRedirect",Be=new Map;class fc extends Lr{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=Be.get(this.auth._key());if(!e){try{const r=await pc(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}Be.set(this.auth._key(),e)}return this.bypassAuthState||Be.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){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function pc(n,e){const t=Ur(e),r=Mr(n);if(!await r._isAvailable())return!1;const i=await r._get(t)==="true";return await r._remove(t),i}async function Gt(n,e){return Mr(n)._set(Ur(e),"true")}function mc(n,e){Be.set(n._key(),e)}function Mr(n){return M(n._redirectPersistence)}function Ur(n){return He(hc,n.config.apiKey,n.name)}/** 1831 * @license 1832 * Copyright 2020 Google LLC 1833 * 1834 * Licensed under the Apache License, Version 2.0 (the "License");
1835 * you may not use this file except in compliance with the License. 1836 * You may obtain a copy of the License at 1837 * 1838 * http://www.apache.org/licenses/LICENSE-2.0 1839 * 1840 * Unless required by applicable law or agreed to in writing, software 1841 * distributed under the License is distributed on an "AS IS" BASIS, 1842 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1843 * See the License for the specific language governing permissions and 1844 * limitations under the License. 1845 */function gc(n,e,t){return Ic(n,e,t)}async function Ic(n,e,t){if(_(n.app))return Promise.reject(w(n));const r=E(n);ue(n,e,W),await r._initializationPromise;const i=Z(r,t);return await Gt(i,r),i._openRedirect(r,e,"signInViaRedirect")}function _c(n,e,t){return Ec(n,e,t)}async function Ec(n,e,t){const r=p(n);if(ue(r.auth,e,W),_(r.auth.app))return Promise.reject(w(r.auth));await r.auth._initializationPromise;const i=Z(r.auth,t);await Gt(i,r.auth);const s=await Vr(r);return i._openRedirect(r.auth,e,"reauthViaRedirect",s)}function yc(n,e,t){return Tc(n,e,t)}async function Tc(n,e,t){const r=p(n);ue(r.auth,e,W),await r.auth._initializationPromise;const i=Z(r.auth,t);await Ze(!1,r,e.providerId),await Gt(i,r.auth);const s=await Vr(r);return i._openRedirect(r.auth,e,"linkViaRedirect",s)}async function wc(n,e){return await E(n)._initializationPromise,Fr(n,e,!1)}async function Fr(n,e,t=!1){if(_(n.app))return Promise.reject(w(n));const r=E(n),i=Z(r,e),o=await new fc(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}async function Vr(n){const e=rt(`${n.uid}:::`);return n._redirectEventId=e,await n.auth._setRedirectUser(n),await n.auth._persistUserIfCurrent(n),e}/** 1846 * @license 1847 * Copyright 2020 Google LLC 1848 * 1849 * Licensed under the Apache License, Version 2.0 (the "License"); 1850 * you may not use this file except in compliance with the License. 1851 * You may obtain a copy of the License at 1852 * 1853 * http://www.apache.org/licenses/LICENSE-2.0 1854 * 1855 * Unless required by applicable law or agreed to in writing, software 1856 * distributed under the License is distributed on an "AS IS" BASIS, 1857 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1858 * See the License for the specific language governing permissions and 1859 * limitations under the License. 1860 */const vc=10*60*1e3;class Ac{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!bc(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!xr(e)){const i=((r=e.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";t.onError(v(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=vc&&this.cachedEventUids.clear(),this.cachedEventUids.has(yn(e))}saveEventToCache(e){this.cachedEventUids.add(yn(e)),this.lastProcessedEventTime=Date.now()}}function yn(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function xr({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function bc(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return xr(n);default:return!1}}/** 1861 * @license 1862 * Copyright 2020 Google LLC 1863 * 1864 * Licensed under the Apache License, Version 2.0 (the "License");
1865 * you may not use this file except in compliance with the License. 1866 * You may obtain a copy of the License at 1867 * 1868 * http://www.apache.org/licenses/LICENSE-2.0 1869 * 1870 * Unless required by applicable law or agreed to in writing, software 1871 * distributed under the License is distributed on an "AS IS" BASIS, 1872 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1873 * See the License for the specific language governing permissions and 1874 * limitations under the License. 1875 */async function Sc(n,e={}){return I(n,"GET","/v1/projects",e)}/** 1876 * @license 1877 * Copyright 2020 Google LLC 1878 * 1879 * Licensed under the Apache License, Version 2.0 (the "License"); 1880 * you may not use this file except in compliance with the License. 1881 * You may obtain a copy of the License at 1882 * 1883 * http://www.apache.org/licenses/LICENSE-2.0 1884 * 1885 * Unless required by applicable law or agreed to in writing, software 1886 * distributed under the License is distributed on an "AS IS" BASIS, 1887 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1888 * See the License for the specific language governing permissions and 1889 * limitations under the License. 1890 */const Rc=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Pc=/^https?/;async function Cc(n){if(n.config.emulator)return;const{authorizedDomains:e}=await Sc(n);for(const t of e)try{if(kc(t))return}catch{}b(n,"unauthorized-domain")}function kc(n){const e=Se(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!Pc.test(t))return!1;if(Rc.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/** 1891 * @license 1892 * Copyright 2020 Google LLC. 1893 * 1894 * Licensed under the Apache License, Version 2.0 (the "License"); 1895 * you may not use this file except in compliance with the License. 1896 * You may obtain a copy of the License at 1897 * 1898 * http://www.apache.org/licenses/LICENSE-2.0 1899 * 1900 * Unless required by applicable law or agreed to in writing, software 1901 * distributed under the License is distributed on an "AS IS" BASIS, 1902 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1903 * See the License for the specific language governing permissions and 1904 * limitations under the License. 1905 */const Nc=new Oe(3e4,6e4);function Tn(){const n=y().___jsl;if(n!=null&&n.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function Oc(n){return new Promise((e,t)=>{var i,s,o;function r(){Tn(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Tn(),t(v(n,"network-request-failed"))},timeout:Nc.get()})}if((s=(i=y().gapi)==null?void 0:i.iframes)!=null&&s.Iframe)e(gapi.iframes.getContext());else if((o=y().gapi)!=null&&o.load)r();else{const a=or("iframefcb");return y()[a]=()=>{gapi.load?r():t(v(n,"network-request-failed"))},Mt(`${lo()}?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw We=null,e})}let We=null;function Dc(n){return We=We||Oc(n),We}/** 1906 * @license 1907 * Copyright 2020 Google LLC. 1908 * 1909 * Licensed under the Apache License, Version 2.0 (the "License"); 1910 * you may not use this file except in compliance with the License. 1911 * You may obtain a copy of the License at 1912 * 1913 * http://www.apache.org/licenses/LICENSE-2.0 1914 * 1915 * Unless required by applicable law or agreed to in writing, software 1916 * distributed under the License is distributed on an "AS IS" BASIS, 1917 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1918 * See the License for the specific language governing permissions and 1919 * limitations under the License. 1920 */const Lc=new Oe(5e3,15e3),Mc="__/auth/iframe",Uc="emulator/auth/iframe",Fc={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Vc=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function xc(n){const e=n.config;l(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Dt(e,Uc):`https://${n.config.authDomain}/${Mc}`,r={apiKey:e.apiKey,appName:n.name,v:Ne},i=Vc.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${ce(r).slice(1)}`}async function Hc(n){const e=await Dc(n),t=y().gapi;return l(t,n,"internal-error"),e.open({where:document.body,url:xc(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Fc,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=v(n,"network-request-failed"),a=y().setTimeout(()=>{s(o)},Lc.get());function c(){y().clearTimeout(a),i(r)}r.ping(c).then(c,()=>{s(o)})}))}/** 1921 * @license 1922 * Copyright 2020 Google LLC. 1923 * 1924 * Licensed under the Apache License, Version 2.0 (the "License");
1925 * you may not use this file except in compliance with the License. 1926 * You may obtain a copy of the License at 1927 * 1928 * http://www.apache.org/licenses/LICENSE-2.0 1929 * 1930 * Unless required by applicable law or agreed to in writing, software 1931 * distributed under the License is distributed on an "AS IS" BASIS, 1932 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1933 * See the License for the specific language governing permissions and 1934 * limitations under the License. 1935 */const Bc={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Wc=500,$c=600,zc="_blank",qc="http://localhost";class wn{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Gc(n,e,t,r=Wc,i=$c){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c={...Bc,width:r.toString(),height:i.toString(),top:s,left:o},u=A().toLowerCase();t&&(a=Zn(u)?zc:t),Xn(u)&&(e=e||qc,c.scrollbars="yes");const h=Object.entries(c).reduce((d,[T,S])=>`${d}${T}=${S},`,"");if(eo(u)&&a!=="_self")return jc(e||"",a),new wn(null);const f=window.open(e||"",a,h);l(f,n,"popup-blocked");try{f.focus()}catch{}return new wn(f)}function jc(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/** 1936 * @license 1937 * Copyright 2021 Google LLC 1938 * 1939 * Licensed under the Apache License, Version 2.0 (the "License"); 1940 * you may not use this file except in compliance with the License. 1941 * You may obtain a copy of the License at 1942 * 1943 * http://www.apache.org/licenses/LICENSE-2.0 1944 * 1945 * Unless required by applicable law or agreed to in writing, software 1946 * distributed under the License is distributed on an "AS IS" BASIS, 1947 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1948 * See the License for the specific language governing permissions and 1949 * limitations under the License. 1950 */const Kc="__/auth/handler",Yc="emulator/auth/handler",Jc=encodeURIComponent("fac");async function vn(n,e,t,r,i,s){l(n.config.authDomain,n,"auth-domain-config-required"),l(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:Ne,eventId:i};if(e instanceof W){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",mi(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[h,f]of Object.entries({}))o[h]=f}if(e instanceof he){const h=e.getScopes().filter(f=>f!=="");h.length>0&&(o.scopes=h.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const h of Object.keys(a))a[h]===void 0&&delete a[h];const c=await n._getAppCheckToken(),u=c?`#${Jc}=${encodeURIComponent(c)}`:"";return`${Xc(n)}?${ce(a).slice(1)}${u}`}function Xc({config:n}){return n.emulator?Dt(n,Yc):`https://${n.authDomain}/${Kc}`}/** 1951 * @license 1952 * Copyright 2020 Google LLC 1953 * 1954 * Licensed under the Apache License, Version 2.0 (the "License"); 1955 * you may not use this file except in compliance with the License. 1956 * You may obtain a copy of the License at 1957 * 1958 * http://www.apache.org/licenses/LICENSE-2.0 1959 * 1960 * Unless required by applicable law or agreed to in writing, software 1961 * distributed under the License is distributed on an "AS IS" BASIS, 1962 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1963 * See the License for the specific language governing permissions and 1964 * limitations under the License. 1965 */const Et="webStorageSupport";class Qc{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Wt,this._completeRedirectFn=Fr,this._overrideRedirectResult=mc}async _openPopup(e,t,r,i){var o;x((o=this.eventManagers[e._key()])==null?void 0:o.manager,"_initialize() not called before _openPopup()");const s=await vn(e,t,r,Se(),i);return Gc(e,s,rt())}
1965async _openRedirect(e,t,r,i){await this._originValidation(e);const s=await vn(e,t,r,Se(),i);return Fa(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(x(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Hc(e),r=new Ac(e);return t.register("authEvent",i=>(l(i==null?void 0: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()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Et,{type:Et},i=>{var o;const s=(o=i==null?void 0:i[0])==null?void 0:o[Et];s!==void 0&&t(!!s),b(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Cc(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ir()||Qn()||Lt()}}const Hr=Qc;class Br{constructor(e){this.factorId=e}_process(e,t,r){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,r);case"signin":return this._finalizeSignIn(e,t.credential);default:return C("unexpected MultiFactorSessionType")}}}class jt extends Br{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new jt(e)}_finalizeEnroll(e,t,r){return Sa(e,{idToken:t,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return Ga(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class Wr{constructor(){}static assertion(e){return jt._fromCredential(e)}}Wr.FACTOR_ID="phone";class $r{static assertionForEnrollment(e,t){return Ce._fromSecret(e,t)}static assertionForSignIn(e,t){return Ce._fromEnrollmentId(e,t)}static async generateSecret(e){var i;const t=e;l(typeof((i=t.user)==null?void 0:i.auth)<"u","internal-error");const r=await Ra(t.user.auth,{idToken:t.credential,totpEnrollmentInfo:{}});return ot._fromStartTotpMfaEnrollmentResponse(r,t.user.auth)}}$r.FACTOR_ID="totp";class Ce extends Br{constructor(e,t,r){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=r}static _fromSecret(e,t){return new Ce(t,void 0,e)}static _fromEnrollmentId(e,t){return new Ce(t,e)}async _finalizeEnroll(e,t,r){return l(typeof this.secret<"u",e,"argument-error"),Pa(e,{idToken:t,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)})}async _finalizeSignIn(e,t){l(this.enrollmentId!==void 0&&this.otp!==void 0,e,"argument-error");const r={verificationCode:this.otp};return ja(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r})}}class ot{constructor(e,t,r,i,s,o,a){this.sessionInfo=o,this.auth=a,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=r,this.codeIntervalSeconds=i,this.enrollmentCompletionDeadline=s}static _fromStartTotpMfaEnrollmentResponse(e,t){return new ot(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,t)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){var i;let r=!1;return(Ve(e)||Ve(t))&&(r=!0),r&&(Ve(e)&&(e=((i=this.auth.currentUser)==null?void 0:i.email)||"unknownuser"),Ve(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function Ve(n){return typeof n>"u"||(n==null?void 0:n.length)===0}var An="@firebase/auth",bn="1.11.1";/** 1966 * @license 1967 * Copyright 2020 Google LLC 1968 * 1969 * Licensed under the Apache License, Version 2.0 (the "License"); 1970 * you may not use this file except in compliance with the License. 1971 * You may obtain a copy of the License at 1972 * 1973 * http://www.apache.org/licenses/LICENSE-2.0 1974 * 1975 * Unless required by applicable law or agreed to in writing, softw
1975are 1976 * distributed under the License is distributed on an "AS IS" BASIS, 1977 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1978 * See the License for the specific language governing permissions and 1979 * limitations under the License. 1980 */class Zc{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)==null?void 0:e.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;const t=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){l(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** 1981 * @license 1982 * Copyright 2020 Google LLC 1983 * 1984 * Licensed under the Apache License, Version 2.0 (the "License"); 1985 * you may not use this file except in compliance with the License. 1986 * You may obtain a copy of the License at 1987 * 1988 * http://www.apache.org/licenses/LICENSE-2.0 1989 * 1990 * Unless required by applicable law or agreed to in writing, software 1991 * distributed under the License is distributed on an "AS IS" BASIS, 1992 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1993 * See the License for the specific language governing permissions and 1994 * limitations under the License. 1995 */function eu(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function tu(n){Ae(new oe("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;l(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const c={apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:sr(n)},u=new oo(r,i,s,c);return yo(u,t),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Ae(new oe("auth-internal",e=>{const t=E(e.getProvider("auth").getImmediate());return(r=>new Zc(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ee(An,bn,eu(n)),Ee(An,bn,"esm2020")}/** 1996 * @license 1997 * Copyright 2021 Google LLC 1998 * 1999 * Licensed under the Apache License, Version 2.0 (the "License"); 2000 * you may not use this file except in compliance with the License. 2001 * You may obtain a copy of the License at 2002 * 2003 * http://www.apache.org/licenses/LICENSE-2.0 2004 * 2005 * Unless required by applicable law or agreed to in writing, software 2006 * distributed under the License is distributed on an "AS IS" BASIS, 2007 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2008 * See the License for the specific language governing permissions and 2009 * limitations under the License. 2010 */const nu=5*60,ru=On("authIdTokenMaxAge")||nu;let Sn=null;const iu=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>ru)return;const i=t==null?void 0:t.token;Sn!==i&&(Sn=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function su(n=_s()){const e=Un(n,"auth");if(e.isInitialized())return e.getImmediate();const t=ur(n,{popupRedirectResolver:Hr,persistence:[Dr,Rr,Wt]}),r=On("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=iu(s.toString());Ar(t,o,()=>o(t.currentUser)),vr(t,a=>o(a))}}const i=Zr("auth");return i&&lr(t,`http://${i}`),t}function ou(){var n;return((n=document.getElementsByTagName("head"))==null?void 0:n[0])??document}ao({loadJS(n){return new Promise((e,t)=>
2010{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=v("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",ou().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="});tu("Browser");const au=Object.freeze(Object.defineProperty({__proto__:null,ActionCodeOperation:Ds,ActionCodeURL:de,AuthCredential:le,AuthErrorCodes:Us,EmailAuthCredential:ae,EmailAuthProvider:Y,FacebookAuthProvider:N,FactorId:Cs,GithubAuthProvider:D,GoogleAuthProvider:O,OAuthCredential:k,OAuthProvider:we,OperationType:Os,PhoneAuthCredential:j,PhoneAuthProvider:Q,PhoneMultiFactorGenerator:Wr,ProviderId:ks,RecaptchaVerifier:Za,SAMLAuthProvider:Ge,SignInMethod:Ns,TotpMultiFactorGenerator:$r,TotpSecret:ot,TwitterAuthProvider:L,applyActionCode:Yo,beforeAuthStateChanged:Ar,browserCookiePersistence:La,browserLocalPersistence:Rr,browserPopupRedirectResolver:Hr,browserSessionPersistence:Wt,checkActionCode:yr,confirmPasswordReset:Ko,connectAuthEmulator:lr,createUserWithEmailAndPassword:Xo,debugErrorMap:Ms,deleteUser:Aa,fetchSignInMethodsForEmail:ra,getAdditionalUserInfo:ma,getAuth:su,getIdToken:Ks,getIdTokenResult:jn,getMultiFactorResolver:ba,getRedirectResult:wc,inMemoryPersistence:St,indexedDBLocalPersistence:Dr,initializeAuth:ur,initializeRecaptchaConfig:Ia,isSignInWithEmailLink:ea,linkWithCredential:_r,linkWithPhoneNumber:nc,linkWithPopup:dc,linkWithRedirect:yc,multiFactor:ka,onAuthStateChanged:Ea,onIdTokenChanged:vr,parseActionCodeURL:Ho,prodErrorMap:Hn,reauthenticateWithCredential:Er,reauthenticateWithPhoneNumber:rc,reauthenticateWithPopup:lc,reauthenticateWithRedirect:_c,reload:Kn,revokeAccessToken:va,sendEmailVerification:ia,sendPasswordResetEmail:jo,sendSignInLinkToEmail:Zo,setPersistence:ga,signInAnonymously:$o,signInWithCredential:et,signInWithCustomToken:Go,signInWithEmailAndPassword:Qo,signInWithEmailLink:ta,signInWithPhoneNumber:tc,signInWithPopup:uc,signInWithRedirect:gc,signOut:wa,unlink:zo,updateCurrentUser:Ta,updateEmail:ca,updatePassword:ua,updatePhoneNumber:ic,updateProfile:aa,useDeviceLanguage:ya,validatePassword:_a,verifyBeforeUpdateEmail:sa,verifyPasswordResetCode:Jo},Symbol.toStringTag,{value:"Module"}));export{O as G,we as O,lr as a,Xo as b,Ko as c,Ks as d,$o as e,wc as f,su as g,uc as h,Is as i,au as j,Ea as o,Ee as r,Qo as s,aa as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.