1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,151718,544073,648591,e=>{"use strict";var t,i=e.i(485086),n=e.i(733015),r=e.i(68483),s=e.i(290571),a=e.i(965233);function o(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}let l=new n.ErrorFactory("auth","Firebase",o()),c=new r.Logger("@firebase/auth");function u(e,...t){c.logLevel<=r.LogLevel.ERROR&&c.error(`Auth (${i.SDK_VERSION}): ${e}`,...t)}function d(e,...t){throw g(e,...t)}function h(e,...t){return g(e,...t)}function p(e,t,i){let r=Object.assign(Object.assign({},o()),{[t]:i});return new n.ErrorFactory("auth","Firebase",r).create(t,{appName:e.name})}function m(e){return p(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function f(e,t,i){if(!(t instanceof i))throw i.name!==t.constructor.name&&d(e,"argument-error"),p(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function g(e,...t){if("string"!=typeof e){let i=t[0],n=[...t.slice(1)];return n[0]&&(n[0].appName=e.name),e._errorFactory.create(i,...n)}return l.create(e,...t)}function I(e,t,...i){if(!e)throw g(t,...i)}function _(e){let t="INTERNAL ASSERTION FAILED: "+e;throw u(t),Error(t)}function v(){var e;return"u">typeof self&&(null==(e=self.location)?void 0:e.href)||""}function T(){return"http:"===E()||"https:"===E()}function E(){var e;return"u">typeof self&&(null==(e=self.location)?void 0:e.protocol)||null}class y{constructor(e,t){this.shortDelay=e,this.longDelay=t,function(e,t){e||_(t)}(t>e,"Short delay should be less than long delay!"),this.isMobile=(0,n.isMobileCordova)()||(0,n.isReactNative)()}get(){return!("u">typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(T()||(0,n.isBrowserExtension)()||"connection"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function w(e,t){var i,n;i=e.emulator,n="Emulator should always be set here",i||_(n);let{url:r}=e.emulator;return t?`${r}${t.startsWith("/")?t.slice(1):t}`:r}class A{static initialize(e,t,i){this.fetchImpl=e,t&&(this.headersImpl=t),i&&(this.responseImpl=i)}static fetch(){return this.fetchImpl?this.fetchImpl:"u">typeof self&&"fetch"in self?self.fetch:"u">typeof globalThis&&globalThis.fetch?globalThis.fetch:"u">typeof fetch?fetch:void _("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"u">typeof self&&"Headers"in self?self.Headers:"u">typeof globalThis&&globalThis.Headers?globalThis.Headers:"u">typeof Headers?Headers:void _("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"u">typeof self&&"Response"in self?self.Response:"u">typeof globalThis&&globalThis.Response?globalThis.Response:"u">typeof Response?Response:void _("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}let S={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-rec
1aptcha-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"},R=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],k=new y(3e4,6e4);function P(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function N(e,t,i,r,s={}){return b(e,s,async()=>{let s={},a={};r&&("GET"===t?a=r:s={body:JSON.stringify(r)});let o=(0,n.querystring)(Object.assign({key:e.config.apiKey},a)).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);let c=Object.assign({method:t,headers:l},s);return(0,n.isCloudflareWorker)()||(c.referrerPolicy="no-referrer"),e.emulatorConfig&&(0,n.isCloudWorkstation)(e.emulatorConfig.host)&&(c.credentials="include"),A.fetch()(await C(e,e.config.apiHost,i,o),c)})}async function b(e,t,i){e._canInitEmulator=!1;let r=Object.assign(Object.assign({},S),t);try{let t=new D(e),n=await Promise.race([i(),t.promise]);t.clearNetworkTimeout();let s=await n.json();if("needConfirmation"in s)throw L(e,"account-exists-with-different-credential",s);if(n.ok&&!("errorMessage"in s))return s;{let[t,i]=(n.ok?s.errorMessage:s.error.message).split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===t)throw L(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===t)throw L(e,"email-already-in-use",s);if("USER_DISABLED"===t)throw L(e,"user-disabled",s);let a=r[t]||t.toLowerCase().replace(/[_\s]+/g,"-");if(i)throw p(e,a,i);d(e,a)}}catch(t){if(t instanceof n.FirebaseError)throw t;d(e,"network-request-failed",{message:String(t)})}}async function O(e,t,i,n,r={}){let s=await N(e,t,i,n,r);return"mfaPendingCredential"in s&&d(e,"multi-factor-auth-required",{_serverResponse:s}),s}async function C(e,t,i,n){let r=`${t}${i}?${n}`,s=e.config.emulator?w(e.config,r):`${e.config.apiScheme}://${r}`;return R.includes(i)&&(await e._persistenceManagerAvailable,"COOKIE"===e._getPersistenceType())?e._getPersistence()._getFinalTarget(s).toString():s}class D{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(h(this.auth,"network-request-failed")),k.get())})}}function L(e,t,i){let n={appName:e.name};i.email&&(n.email=i.email),i.phoneNumber&&(n.phoneNumber=i.phoneNumber);let r=h(e,t,n);return r.customData._tokenResponse=i,r}function M(e){return void 0!==e&&void 0!==e.getResponse}function U(e){return void 0!==e&&void 0!==e.enterprise}class F{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)switch(t.enforcementState){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function V(e){return(await N(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function x(e,t){return N(e,"GET","/v2/recaptchaConfig",P(e,t))}async function H(e,t){return N(e,"POST","/v1/accounts:delete",t)}async function j(e,t){return N(e,"POST","/v1/accounts:update",t)}async function q(e,t){return N(e,"POST","/v1/accounts:lookup",t)}function W(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}async function G(e,t=!1){let i=(0,n.getModularInstance)(e),r=await i.getIdToken(t),s=K(r);I(s&&s.exp&&s.auth_time&&s.iat,i.auth,"internal-error");let a="object"==typeof s.firebase?s.firebase:void 0,o=null==a?void 0:a.sign_in_provider;return{claims:s,token:r,authTime:W(z(s.auth_time)),issuedAtTime:W(z(s.iat)),expirationTime:W(z(s.exp)),signInProvider:o||null,signInSecondFactor:(null==a?void 0:a.sign_in_second_factor)||null}}function z(e){return 1e3*Number(e)}function K(e){let[t,i,r]=e.split(".");if(void 0===t||void 0===i||void 0===r)return u("JWT malformed, contained fewer than 3 sections"),null;try{let e=(0,n.base64Decode)(i);if(!e)return u("Failed to decode base64 JWT payload"),null;return JSON.parse(e)}catch(e){return u("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}function $(e){let t=K(e);return I(t,"internal-error"),I(void 0!==t.exp,"internal-error"),I(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function B(e,t,i=!1){if(i)return t;try{return await t}catch(t){throw t instanceof n.FirebaseError&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class J{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(!e)return this.errorBackoff=3e4,Math.max(0,(null!=(t=this.user.stsTokenManager.expirationTime)?t:0)-Date.now()-3e5);{let e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(null==e?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}class Y{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=W(this.lastLoginAt),this.creationTime=W(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function X(e){var t,i,n;let r=e.auth,s=await e.getIdToken(),a=await B(e,q(r,{idToken:s}));I(null==a?void 0:a.users.length,r,"internal-error");let o=a.users[0];e._notifyReloadListener(o);let l=(null==(t=o.providerUserInfo)?void 0:t.length)?Z(o.providerUserInfo):[],c=(i=e.providerData,n=l,[...i.filter(e=>!n.some(t=>t.providerId===e.providerId)),...n]),u=e.isAnonymous,d=!(e.email&&o.passwordHash)&&!(null==c?void 0:c.length);Object.assign(e,{uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:c,metadata:new Y(o.createdAt,o.lastLoginAt),isAnonymous:!!u&&d})}async function Q(e){let t=(0,n.getModularInstance)(e);await X(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function Z(e){return e.map(e=>{var{providerId:t}=e,i=(0,s.__rest)(e,["providerId"]);
1return{providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}})}async function ee(e,t){let i=await b(e,{},async()=>{let i=(0,n.querystring)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:s}=e.config,a=await C(e,r,"/v1/token",`key=${s}`),o=await e._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";let l={method:"POST",headers:o,body:i};return e.emulatorConfig&&(0,n.isCloudWorkstation)(e.emulatorConfig.host)&&(l.credentials="include"),A.fetch()(a,l)});return{accessToken:i.access_token,expiresIn:i.expires_in,refreshToken:i.refresh_token}}async function et(e,t){return N(e,"POST","/v2/accounts:revokeToken",P(e,t))}class ei{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){I(e.idToken,"internal-error"),I(void 0!==e.idToken,"internal-error"),I(void 0!==e.refreshToken,"internal-error");let t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):$(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){I(0!==e.length,"internal-error");let t=$(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(I(this.refreshToken,e,"user-token-expired"),this.refreshToken)?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:i,refreshToken:n,expiresIn:r}=await ee(e,t);this.updateTokensAndExpiration(i,n,Number(r))}updateTokensAndExpiration(e,t,i){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*i}static fromJSON(e,t){let{refreshToken:i,accessToken:n,expirationTime:r}=t,s=new ei;return i&&(I("string"==typeof i,"internal-error",{appName:e}
1),s.refreshToken=i),n&&(I("string"==typeof n,"internal-error",{appName:e}),s.accessToken=n),r&&(I("number"==typeof r,"internal-error",{appName:e}),s.expirationTime=r),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new ei,this.toJSON())}_performRefresh(){return _("not implemented")}}function en(e,t){I("string"==typeof e||void 0===e,"internal-error",{appName:t})}class er{constructor(e){var{uid:t,auth:i,stsTokenManager:n}=e,r=(0,s.__rest)(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new J(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=n,this.accessToken=n.accessToken,this.displayName=r.displayName||null,this.email=r.email||null,this.emailVerified=r.emailVerified||!1,this.phoneNumber=r.phoneNumber||null,this.photoURL=r.photoURL||null,this.isAnonymous=r.isAnonymous||!1,this.tenantId=r.tenantId||null,this.providerData=r.providerData?[...r.providerData]:[],this.metadata=new Y(r.createdAt||void 0,r.lastLoginAt||void 0)}async getIdToken(e){let t=await B(this,this.stsTokenManager.getToken(this.auth,e));return I(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return G(this,e)}reload(){return Q(this)}_assign(e){this!==e&&(I(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new er(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){I(!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 i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await X(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if((0,i._isFirebaseServerApp)(this.auth.app))return Promise.reject(m(this.auth));let e=await this.getIdToken();return await B(this,H(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({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=>Object.assign({},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){var i,n,r,s,a,o,l,c;let u=null!=(i=t.displayName)?i:void 0,d=null!=(n=t.email)?n:void 0,h=null!=(r=t.phoneNumber)?r:void 0,p=null!=(s=t.photoURL)?s:void 0,m=null!=(a=t.tenantId)?a:void 0,f=null!=(o=t._redirectEventId)?o:void 0,g=null!=(l=t.createdAt)?l:void 0,_=null!=(c=t.lastLoginAt)?c:void 0,{uid:v,emailVerified:T,isAnonymous:E,providerData:y,stsTokenManager:w}=t;I(v&&w,e,"internal-error");let A=ei.fromJSON(this.name,w);I("string"==typeof v,e,"internal-error"),en(u,e.name),en(d,e.name),I("boolean"==typeof T,e,"internal-error"),I("boolean"==typeof E,e,"internal-error"),en(h,e.name),en(p,e.name),en(m,e.name),en(f,e.
1name),en(g,e.name),en(_,e.name);let S=new er({uid:v,auth:e,email:d,emailVerified:T,displayName:u,isAnonymous:E,photoURL:p,phoneNumber:h,tenantId:m,stsTokenManager:A,createdAt:g,lastLoginAt:_});return y&&Array.isArray(y)&&(S.providerData=y.map(e=>Object.assign({},e))),f&&(S._redirectEventId=f),S}static async _fromIdTokenResponse(e,t,i=!1){let n=new ei;n.updateFromServerResponse(t);let r=new er({uid:t.localId,auth:e,stsTokenManager:n,isAnonymous:i});return await X(r),r}static async _fromGetAccountInfoResponse(e,t,i){let n=t.users[0];I(void 0!==n.localId,"internal-error");let r=void 0!==n.providerUserInfo?Z(n.providerUserInfo):[],s=!(n.email&&n.passwordHash)&&!(null==r?void 0:r.length),a=new ei;a.updateFromIdToken(i);let o=new er({uid:n.localId,auth:e,stsTokenManager:a,isAnonymous:s});return Object.assign(o,{uid:n.localId,displayName:n.displayName||null,photoURL:n.photoUrl||null,email:n.email||null,emailVerified:n.emailVerified||!1,phoneNumber:n.phoneNumber||null,tenantId:n.tenantId||null,providerData:r,metadata:new Y(n.createdAt,n.lastLoginAt),isAnonymous:!(n.email&&n.passwordHash)&&!(null==r?void 0:r.length)}),o}}let es=new Map;function ea(e){var t,i;t="Expected a class definition",e instanceof Function||_(t);let n=es.get(e);return n?(i="Instance stored in cache mismatched with class",n instanceof e||_(i)):(n=new e,es.set(e,n)),n}class eo{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}function el(e,t,i){return`firebase:${e}:${t}:${i}`}eo.type="NONE";class ec{constructor(e,t,i){this.persistence=e,this.auth=t,this.userKey=i;const{config:n,name:r}=this.auth;this.fullUserKey=el(this.userKey,n.apiKey,r),this.fullPersistenceKey=el("persistence",n.apiKey,r),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"==typeof e){let t=await q(this.auth,{idToken:e}).catch(()=>void 0);return t?er._fromGetAccountInfoResponse(this.auth,t,e):null}return er._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,i="authUser"){if(!t.length)return new ec(ea(eo),e,i);let n=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),r=n[0]||ea(eo),s=el(i,e.config.apiKey,e.name),a=null;for(let i of t)try{let t=await i._get(s);if(t){let n;if("string"==typeof t){let i=await q(e,{idToken:t}).catch(()=>void 0);if(!i)break;n=await er._fromGetAccountInfoResponse(e,i,t)}else n=er._fromJSON(e,t);i!==r&&(a=n),r=i;break}}catch(e){}let o=n.filter(e=>e._shouldAllowMigration);return r._shouldAllowMigration&&o.length&&(r=o[0],a&&await r._set(s,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==r)try{await e._remove(s)}catch(e){}}))),new ec(r,e,i)}}function eu(e){let t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";{if(em(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(ed(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(eg(t))return"Blackberry";if(eI(t))return"Webos";if(eh(t))return"Safari";if((t.includes("chrome/")||ep(t))&&!t.includes("edge/"))return"Chrome";if(ef(t))return"Android";let i=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if((null==i?void 0:i.length)===2)return i[1]}return"Other"}function ed(e=(0,n.getUA)()){return/firefox\//i.test(e)}function eh(e=(0,n.getUA)()){let t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function ep(e=(0,n.getUA)()){return/crios\//i.test(e)}function em(e=(0,n.getUA)()){return/iemobile/i.test(e)}function ef(e=(0,n.getUA)()){return/android/i.test(e)}function eg(e=(0,n.getUA)()){return/blackberry/i.test(e)}function eI(e=(0,n.getUA)()){return/webos/i.test(e)}function e_(e=(0,n.getUA)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function ev(e=(0,n.getUA)()){return e_(e)||ef(e)||eI(e)||eg(e)||/windows phone/i.test(e)||em(e)}function eT(e,t=[]){let r;switch(e){case"Browser":r=eu((0,n.getUA)());break;case"Worker":r=`${eu((0,n.getUA)())}-${e}`;break;default:r=e}let s=t.length?t.join(","):"FirebaseCore-web";return`${r}/JsCore/${i.SDK_VERSION}/${s}`}class eE{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let i=t=>new Promise((i,n)=>{try{let n=e(t);i(n)}catch(e){n(e)}});i.onAbort=t,this.queue.push(i);let n=this.queue.length-1;return()=>{this.queue[n]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let i of this.queue)await i(e),i.onAbort&&t.push(i.onAbort)}catch(e){for(let e of(t.reverse(),t))try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}async function ey(e,t={}){return N(e,"GET","/v2/passwordPolicy",P(e,t))}class ew{constructor(e){var t,i,n,r;const s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!=(t=s.minPasswordLength)?t:6,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),void 0!==s.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),void 0!==s.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),void 0!==s.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),void 0!==s.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!=(n=null==(i=e.allowedNonAlphanumericCharacters)?void 0:i.join(""))?n:"",this.forceUpgradeOnSignin=null!=(r=e.forceUpgradeOnSignin)&&r,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,i,n,r,s,a;let o={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,o),this.validatePasswordCharacterOptions(e,o),o.isValid&&
1(o.isValid=null==(t=o.meetsMinPasswordLength)||t),o.isValid&&(o.isValid=null==(i=o.meetsMaxPasswordLength)||i),o.isValid&&(o.isValid=null==(n=o.containsLowercaseLetter)||n),o.isValid&&(o.isValid=null==(r=o.containsUppercaseLetter)||r),o.isValid&&(o.isValid=null==(s=o.containsNumericCharacter)||s),o.isValid&&(o.isValid=null==(a=o.containsNonAlphanumericCharacter)||a),o}validatePasswordLengthOptions(e,t){let i=this.customStrengthOptions.minPasswordLength,n=this.customStrengthOptions.maxPasswordLength;i&&(t.meetsMinPasswordLength=e.length>=i),n&&(t.meetsMaxPasswordLength=e.length<=n)}validatePasswordCharacterOptions(e,t){let i;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let n=0;n<e.length;n++)i=e.charAt(n),this.updatePasswordCharacterOptionsStatuses(t,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(e,t,i,n,r){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=n)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=r))}}class eA{constructor(e,t,i,n){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new eR(this),this.idTokenSubscription=new eR(this),this.beforeStateQueue=new eE(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=l,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=n.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=ea(t)),this._initializationPromise=this.queue(async()=>{var i,n,r;if(!this._deleted){if(this.persistenceManager=await ec.create(this,e),null==(i=this._resolvePersistenceManagerAvailable)||i.call(this),!this._deleted){if(null==(n=this._popupRedirectResolver)?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null==(r=this.currentUser)?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(this.currentUser||e){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{let t=await q(this,{idToken:e}),i=await er._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if((0,i._isFirebaseServerApp)(this.app)){let e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}let n=await this.assertedPersistence.getCurrentUser(),r=n,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let i=null==(t=this.redirectUser)?void 0:t._redirectEventId,n=null==r?void 0:r._redirectEventId,a=await this.tryRedirectSignIn(e);(!i||i===n)&&(null==a?void 0:a.user)&&(r=a.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);
1if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(e){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return(I(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId)?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await X(e)}catch(e){if((null==e?void 0:e.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("u"<typeof navigator)return null;let e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if((0,i._isFirebaseServerApp)(this.app))return Promise.reject(m(this));let t=e?(0,n.getModularInstance)(e):null;return t&&I(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&&I(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(0,i._isFirebaseServerApp)(this.app)?Promise.reject(m(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return(0,i._isFirebaseServerApp)(this.app)?Promise.reject(m(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ea(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let e=new ew(await ey(this));null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new n.ErrorFactory("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){let t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await et(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null==(e=this._currentUser)?void 0:e.toJSON()}}async _setRedirectUser(e,t){let i=await this.getOrInitRedirectPersistenceManager(t);return null===e?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&ea(e)||this._popupRedirectResolver;I(t,this,"argument-error"),this.redirectPersistenceManager=await ec.create(this,[ea(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,i;return(this._isInitialized&&await this.queue(async()=>{}),(null==(t=this._currentUser)?void 0:t._redirectEventId)===e)?this._currentUser:(null==(i=this.redirectUser)?void 0:i._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 e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let i=null!=(t=null==(e=this.currentUser)?void 0:e.uid)?t:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,n){if(this._deleted)return()=>{};let r="function"==typeof t?t:t.next.bind(t),s=!1,a=this._isInitialized?Promise.resolve():this._initializationPromise;if(I(a,this,"internal-error"),a.then(()=>{s||r(this.currentUser)}),"function"==typeof t){let r=e.addObserver(t,i,n);return()=>{s=!0,r()}}{let i=e.addObserver(t);return()=>{s=!0,i()}}}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 I(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=eT(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;let t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);let i=await (null==(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))?void 0:e.getHeartbeatsHeader());i&&(t["X-Firebase-Client"]=i);let n=await this._getAppCheckToken();return n&&(t["X-Firebase-AppCheck"]=n),t}async _getAppCheckToken(){var e;if((0,i._isFirebaseServerApp)(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let t=await (null==(e=this.appCheckServiceProvider.getImmediate({optional:!0}))?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){c.logLevel<=r.LogLevel.WARN&&c.warn(`Auth (${i.SDK_VERSION}): ${e}`,...t)}(`Error while retrieving App Check token: ${t.error}`),null==t?void 0:t.token}}function eS(e){return(0,n.getModularInstance)(e)}class eR{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,n.createSubscribe)(e=>this.observer=e)}get next(){return I(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let ek={async loadJS(){throw Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function eP(e){return ek.loadJS(e)}function eN(e){return`__${e}${Math.floor(1e6*Math.random())}`}class eb{constructor(e){this.auth=e,this.counter=1e12,this._widgets=new Map}render(e,t){let i=this.counter;return this._widgets.set(i,new eD(e,this.auth.name,t||{})),this.counter++,i}reset(e){var t;let i=e||1e12;null==(t=this._widgets.get(i))||t.delete(),this._widgets.delete(i)}getResponse(e){var t;return(null==(t=this._widgets.get(e||1e12))?void 0:t.getResponse())||""}async execute(e){var t;return null==(t=this._widgets.get(e||1e12))||t.execute(),""}}class eO{constructor(){this.enterprise=new eC}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class eC{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class eD{constructor(e,t,i){this.params=i,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const n="string"==typeof e?document.getElementById(e):e;I(n,"argument-error",{appName:t}),this.container=n,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout(()=>{this.responseToken=function(){let e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let i=0;i<50;i++)e.push(t.charAt(Math.floor(Math.random()*t.length)));return e.join("")}();let{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()},6e4)},500))}checkIfDeleted(){if(this.deleted)throw Error("reCAPTCHA mock was already deleted!")}}let eL="NO_RECAPTCHA";class eM{constructor(e){this.type="recaptcha-enterprise",this.auth=eS(e)}async verify(e="verify",t=!1){async function i(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,i)=>
1{x(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(n=>{if(void 0===n.recaptchaKey)i(Error("recaptcha Enterprise site key undefined"));else{let i=new F(n);return null==e.tenantId?e._agentRecaptchaConfig=i:e._tenantRecaptchaConfigs[e.tenantId]=i,t(i.siteKey)}}).catch(e=>{i(e)})})}function n(t,i,n){let r=window.grecaptcha;U(r)?r.enterprise.ready(()=>{r.enterprise.execute(t,{action:e}).then(e=>{i(e)}).catch(()=>{i(eL)})}):n(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new eO().execute("siteKey",{action:"verify"}):new Promise((e,r)=>{i(this.auth).then(i=>{if(!t&&U(window.grecaptcha))n(i,e,r);else{if("u"<typeof window)return void r(Error("RecaptchaVerifier is only supported in browser"));let t=ek.recaptchaEnterpriseScript;0!==t.length&&(t+=i),eP(t).then(()=>{n(i,e,r)}).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function eU(e,t,i,n=!1,r=!1){let s,a=new eM(e);if(r)s=eL;else try{s=await a.verify(i)}catch(e){s=await a.verify(i,!0)}let o=Object.assign({},t);if("mfaSmsEnrollment"===i||"mfaSmsSignIn"===i){if("phoneEnrollmentInfo"in o){let e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){let e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return n?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function eF(e,t,i,n,r){var s,a;if("EMAIL_PASSWORD_PROVIDER"===r)if(null==(s=e._getRecaptchaConfig())||!s.isProviderEnabled("EMAIL_PASSWORD_PROVIDER"))return n(e,t).catch(async r=>{if("auth/missing-recaptcha-token"!==r.code)return Promise.reject(r);{console.log(`${i} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let r=await eU(e,t,i,"getOobCode"===i);return n(e,r)}});else{let r=await eU(e,t,i,"getOobCode"===i);return n(e,r)}if("PHONE_PROVIDER"!==r)return Promise.reject(r+" provider is not supported.");if(null==(a=e._getRecaptchaConfig())?void 0:a.isProviderEnabled("PHONE_PROVIDER")){let r=await eU(e,t,i);return n(e,r).catch(async r=>{var s;if((null==(s=e._getRecaptchaConfig())?void 0:s.getProviderEnforcementState("PHONE_PROVIDER"))==="AUDIT"&&("auth/missing-recaptcha-token"===r.code||"auth/invalid-app-credential"===r.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${i} flow.`);let r=await eU(e,t,i,!1,!0);return n(e,r)}return Promise.reject(r)})}{let r=await eU(e,t,i,!1,!0);return n(e,r)}}async function eV(e){let t=eS(e),i=new F(await x(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}));null==t.tenantId?t._agentRecaptchaConfig=i:t._tenantRecaptchaConfigs[t.tenantId]=i,i.isAnyProviderEnabled()&&new eM(t).verify()}function ex(e,t){let r=(0,i._getProvider)(e,"auth");if(r.isInitialized()){let e=r.getImmediate(),i=r.getOptions();if((0,n.deepEqual)(i,null!=t?t:{}))return e;d(e,"already-initialized")}return r.initialize({options:t})}function eH(e,t,i){let r=eS(e);I(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");let s=!!(null==i?void 0:i.disableWarnings),a=ej(t),{host:o,port:l}=function(e){let t=ej(e),i=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!i)return{host:"",port:null};let n=i[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(n);if(r){let e=r[1];return{host:e,port:eq(n.substr(e.length+1))}}{let[e,t]=n.split(":");return{host:e,port:eq(t)}}}(t),c=null===l?"":`:${l}`,u={url:`${a}//${o}${c}/`},d=Object.freeze({host:o,port:l,protocol:a.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){I(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),I((0,n.deepEqual)(u,r.config.emulator)&&(0,n.deepEqual)(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,(0,n.isCloudWorkstation)(o)?((0,n.pingServer)(`${a}//${o}${c}`),(0,n.updateEmulatorBanner)("Auth",!0)):s||function(){function e(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"u">typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),"u">typeof window&&"u">typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function ej(e){let t=e.indexOf(":");
1return t<0?"":e.substr(0,t+1)}function eq(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}class eW{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return _("not implemented")}_getIdTokenResponse(e){return _("not implemented")}_linkToIdToken(e,t){return _("not implemented")}_getReauthenticationResolver(e){return _("not implemented")}}async function eG(e,t){return N(e,"POST","/v1/accounts:resetPassword",P(e,t))}async function ez(e,t){return N(e,"POST","/v1/accounts:update",t)}async function eK(e,t){return N(e,"POST","/v1/accounts:signUp",t)}async function e$(e,t){return N(e,"POST","/v1/accounts:update",P(e,t))}async function eB(e,t){return O(e,"POST","/v1/accounts:signInWithPassword",P(e,t))}async function eJ(e,t){return N(e,"POST","/v1/accounts:sendOobCode",P(e,t))}async function eY(e,t){return eJ(e,t)}async function eX(e,t){return eJ(e,t)}async function eQ(e,t){return eJ(e,t)}async function eZ(e,t){return eJ(e,t)}async function e0(e,t){return O(e,"POST","/v1/accounts:signInWithEmailLink",P(e,t))}async function e1(e,t){return O(e,"POST","/v1/accounts:signInWithEmailLink",P(e,t))}class e3 extends eW{constructor(e,t,i,n=null){super("password",i),this._email=e,this._password=t,this._tenantId=n}static _fromEmailAndPassword(e,t){return new e3(e,t,"password")}static _fromEmailAndCode(e,t,i=null){return new e3(e,t,"emailLink",i)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t="string"==typeof e?JSON.parse(e):e;if((null==t?void 0:t.email)&&(null==t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);else if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return eF(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",eB,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return e0(e,{email:this._email,oobCode:this._password});default:d(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return eF(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",eK,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return e1(e,{idToken:t,email:this._email,oobCode:this._password});default:d(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function e2(e,t){return O(e,"POST","/v1/accounts:signInWithIdp",P(e,t))}class e4 extends eW{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new e4(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&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):d("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
1once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let t="string"==typeof e?JSON.parse(e):e,{providerId:i,signInMethod:n}=t,r=(0,s.__rest)(t,["providerId","signInMethod"]);if(!i||!n)return null;let a=new e4(i,n);return a.idToken=r.idToken||void 0,a.accessToken=r.accessToken||void 0,a.secret=r.secret,a.nonce=r.nonce,a.pendingToken=r.pendingToken||null,a}_getIdTokenResponse(e){return e2(e,this.buildRequest())}_linkToIdToken(e,t){let i=this.buildRequest();return i.idToken=t,e2(e,i)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,e2(e,t)}buildRequest(){let e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,n.querystring)(t)}return e}}async function e5(e,t){return N(e,"POST","/v1/accounts:sendVerificationCode",P(e,t))}async function e6(e,t){return O(e,"POST","/v1/accounts:signInWithPhoneNumber",P(e,t))}async function e8(e,t){let i=await O(e,"POST","/v1/accounts:signInWithPhoneNumber",P(e,t));if(i.temporaryProof)throw L(e,"account-exists-with-different-credential",i);return i}let e7={USER_NOT_FOUND:"user-not-found"};async function e9(e,t){return O(e,"POST","/v1/accounts:signInWithPhoneNumber",P(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),e7)}class te extends eW{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new te({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new te({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return e6(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return e8(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return e9(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:i,verificationCode:n}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:i,code:n}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));let{verificationId:t,verificationCode:i,phoneNumber:n,temporaryProof:r}=e;return i||t||n||r?new te({verificationId:t,verificationCode:i,phoneNumber:n,temporaryProof:r}):null}}class tt{constructor(e){var t,i,r,s,a,o;const l=(0,n.querystringDecode)((0,n.extractQuerystring)(e)),c=null!=(t=l.apiKey)?t:null,u=null!=(i=l.oobCode)?i:null,d=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!=(r=l.mode)?r:null);I(c&&u&&d,"argument-error"),this.apiKey=c,this.operation=d,this.code=u,this.continueUrl=null!=(s=l.continueUrl)?s:null,this.languageCode=null!=(a=l.lang)?a:null,this.tenantId=null!=(o=l.tenantId)?o:null}static parseLink(e){let t,i,r,s=(i=(t=(0,n.querystringDecode)((0,n.extractQuerystring)(e)).link)?(0,n.querystringDecode)((0,n.extractQuerystring)(t)).deep_link_id:null,((r=(0,n.querystringDecode)((0,n.extractQuerystring)(e)).deep_link_id)?(0,n.querystringDecode)((0,n.extractQuerystring)(r)).link:null)||r||i||t||e);try{return new tt(s)}catch(e){return null}}}class ti{constructor(){this.providerId=ti.PROVIDER_ID}static credential(e,t){return e3._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let i=tt.parseLink(t);return I(i,"argument-error"),e3._fromEmailAndCode(e,i.code,i.tenantId)}}ti.PROVIDER_ID="password",ti.EMAIL_PASSWORD_SIGN_IN_METHOD="password",ti.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class tn{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class tr extends tn{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class ts extends tr{static credentialFromJSON(e){let t="string"==typeof e?JSON.parse(e):e;return I("providerId"in t&&"signInMethod"in t,"argument-error"),e4._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return I(e.idToken||e.accessToken,"argument-error"),e4._fromParams(Object.assign(Object.assign({}
1,e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return ts.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return ts.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:i,oauthTokenSecret:n,pendingToken:r,nonce:s,providerId:a}=e;if(!i&&!n&&!t&&!r||!a)return null;try{return new ts(a)._credential({idToken:t,accessToken:i,nonce:s,pendingToken:r})}catch(e){return null}}}class ta extends tr{constructor(){super("facebook.com")}static credential(e){return e4._fromParams({providerId:ta.PROVIDER_ID,signInMethod:ta.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ta.credentialFromTaggedObject(e)}static credentialFromError(e){return ta.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return ta.credential(e.oauthAccessToken)}catch(e){return null}}}ta.FACEBOOK_SIGN_IN_METHOD="facebook.com",ta.PROVIDER_ID="facebook.com";class to extends tr{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return e4._fromParams({providerId:to.PROVIDER_ID,signInMethod:to.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return to.credentialFromTaggedObject(e)}static credentialFromError(e){return to.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:i}=e;if(!t&&!i)return null;try{return to.credential(t,i)}catch(e){return null}}}to.GOOGLE_SIGN_IN_METHOD="google.com",to.PROVIDER_ID="google.com";class tl extends tr{constructor(){super("github.com")}static credential(e){return e4._fromParams({providerId:tl.PROVIDER_ID,signInMethod:tl.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return tl.credentialFromTaggedObject(e)}static credentialFromError(e){return tl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return tl.credential(e.oauthAccessToken)}catch(e){return null}}}tl.GITHUB_SIGN_IN_METHOD="github.com",tl.PROVIDER_ID="github.com";class tc extends eW{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return e2(e,this.buildRequest())}_linkToIdToken(e,t){let i=this.buildRequest();return i.idToken=t,e2(e,i)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,e2(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let{providerId:t,signInMethod:i,pendingToken:n}="string"==typeof e?JSON.parse(e):e;return t&&i&&n&&t===i?new tc(t,n):null}static _create(e,t){return new tc(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class tu extends tn{constructor(e){I(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return tu.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return tu.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let t=tc.fromJSON(e);return I(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:t,providerId:i}=e;if(!t||!i)return null;try{return tc._create(i,t)}catch(e){return null}}}class td extends tr{constructor(){super("twitter.com")}static credential(e,t){return e4._fromParams({providerId:td.PROVIDER_ID,signInMethod:td.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return td.credentialFromTaggedObject(e)}static credentialFromError(e){return td.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:i}=e;if(!t||!i)return null;try{return td.credential(t,i)}catch(e){return null}}}async function th(e,t){return O(e,"POST","/v1/accounts:signUp",P(e,t))}td.TWITTER_SIGN_IN_METHOD="twitter.com",td.PROVIDER_ID="twitter.com";class tp{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,i,n=!1){return new tp({user:await er._fromIdTokenResponse(e,i,n),providerId:tm(i),_tokenResponse:i,operationType:t})}static async _forOperation(e,t,i){return await e._updateTokensIfNecessary(i,!0),new tp({user:e,providerId:tm(i),_tokenResponse:i,operationType:t})}}function tm(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}async function tf(e){var t;if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(m(e));let n=eS(e);if(await n._initializationPromise,null==(t=n.currentUser)?void 0:t.isAnonymous)return new tp({user:n.currentUser,providerId:null,operationType:"signIn"});let r=await th(n,{returnSecureToken:!0}),s=await tp._fromIdTokenResponse(n,"signIn",r,!0);return await n._updateCurrentUser(s.user),s}class tg extends n.FirebaseError{constructor(e,t,i,n){var r;super(t.code,t.message),this.operationType=i,this.user=n,Object.setPrototypeOf(this,tg.prototype),this.customData={appName:e.n
1ame,tenantId:null!=(r=e.tenantId)?r:void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,n){return new tg(e,t,i,n)}}function tI(e,t,i,n){return("reauthenticate"===t?i._getReauthenticationResolver(e):i._getIdTokenResponse(e)).catch(i=>{if("auth/multi-factor-auth-required"===i.code)throw tg._fromErrorAndOperation(e,i,t,n);throw i})}function t_(e){return new Set(e.map(({providerId:e})=>e).filter(e=>!!e))}async function tv(e,t){let i=(0,n.getModularInstance)(e);await tE(!0,i,t);let{providerUserInfo:r}=await j(i.auth,{idToken:await i.getIdToken(),deleteProvider:[t]}),s=t_(r||[]);return i.providerData=i.providerData.filter(e=>s.has(e.providerId)),s.has("phone")||(i.phoneNumber=null),await i.auth._persistUserIfCurrent(i),i}async function tT(e,t,i=!1){let n=await B(e,t._linkToIdToken(e.auth,await e.getIdToken()),i);return tp._forOperation(e,"link",n)}async function tE(e,t,i){await X(t),I(t_(t.providerData).has(i)===e,t.auth,!1===e?"provider-already-linked":"no-such-provider")}async function ty(e,t,n=!1){let{auth:r}=e;if((0,i._isFirebaseServerApp)(r.app))return Promise.reject(m(r));let s="reauthenticate";try{let i=await B(e,tI(r,s,t,e),n);I(i.idToken,r,"internal-error");let a=K(i.idToken);I(a,r,"internal-error");let{sub:o}=a;return I(e.uid===o,r,"user-mismatch"),tp._forOperation(e,s,i)}catch(e){throw(null==e?void 0:e.code)==="auth/user-not-found"&&d(r,"user-mismatch"),e}}async function tw(e,t,n=!1){if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(m(e));let r="signIn",s=await tI(e,r,t),a=await tp._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(a.user),a}async function tA(e,t){return tw(eS(e),t)}async function tS(e,t){let i=(0,n.getModularInstance)(e);return await tE(!1,i,t.providerId),tT(i,t)}async function tR(e,t){return ty((0,n.getModularInstance)(e),t)}async function tk(e,t){return O(e,"POST","/v1/accounts:signInWithCustomToken",P(e,t))}async function tP(e,t){if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(m(e));let n=eS(e),r=await tk(n,{token:t,returnSecureToken:!0}),s=await tp._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(s.user),s}class tN{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?tb._fromServerResponse(e,t):"totpInfo"in t?tO._fromServerResponse(e,t):d(e,"internal-error")}}class tb extends tN{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new tb(t)}}class tO extends tN{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new tO(t)}}function tC(e,t,i){var n;I((null==(n=i.url)?void 0:n.length)>0,e,"invalid-continue-uri"),I(void 0===i.dynamicLinkDomain||i.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),I(void 0===i.linkDomain||i.linkDomain.length>0,e,"invalid-hosting-link-domain"),t.continueUrl=i.url,t.dynamicLinkDomain=i.dynamicLinkDomain,t.linkDomain=i.linkDomain,t.canHandleCodeInApp=i.handleCodeInApp,i.iOS&&(I(i.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=i.iOS.bundleId),i.android&&(I(i.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=i.android.installApp,t.androidMinimumVersionCode=i.android.minimumVersion,t.androidPackageName=i.android.packageName)}async function tD(e){let t=eS(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function tL(e,t,i){let n=eS(e),r={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};i&&tC(n,r,i),await eF(n,r,"getOobCode",eX,"EMAIL_PASSWORD_PROVIDER")}async function tM(e,t,i){await eG((0,n.getModularInstance)(e),{oobCode:t,newPassword:i}).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tD(e),t})}async function tU(e,t){await e$((0,n.getModularInstance)(e),{oobCode:t})}async function tF(e,t){let i=(0,n.getModularInstance)(e),r=await eG(i,{oobCode:t}),s=r.requestType;switch(I(s,i,"internal-error"),s){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":I(r.newEmail,i,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":I(r.mfaInfo,i,"internal-error");default:I(r.email,i,"internal-error")}let a=null;return r.mfaInfo&&(a=tN._fromServerResponse(eS(i),r.mfaInfo)),{data:{email:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.newEmail:r.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.email:r.newEmail)||null,multiFactorInfo:a},operation:s}}async function tV(e,t){let{data:i}=await tF((0,n.getModularInstance)(e),t);return i.email}async function tx(e,t,n){if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(m(e));let r=eS(e),s=eF(r,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",th,"EMAIL_PASSWORD_PROVIDER"),a=await s.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tD(e),t}),o=await tp._fromIdTokenResponse(r,"signIn",a);return await r._updateCurrentUser(o.user),o}async function tH(e,t,i){let n=eS(e),r={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};I(i.handleCodeInApp,n,"argument-error"),i&&tC(n,r,i),await eF(n,r,"getOobCode",eQ,"EMAIL_PASSWORD_PROVIDER")}async function tj(e,t,r){if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(m(e));let s=(0,n.getModularInstance)(e),a=ti.credentialWithLink(t,r||v());return I(a._tenantId===(s.tenantId||null),s,"tenant-id-mismatch"),tA(s,a)}async function tq(e,t){return N(e,"POST","/v1/accounts:createAuthUri",P(e,t))}async function tW(e,t){let i=T()?v():"http://localhost",{signinMethods:r}=await tq((0,n.getModularInstance)(e),{identifier:t,continueUri:i});return r||[]}async function tG(e,t){let i=(0,n.getModularInstance)(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&tC(i.auth,r,t);let{email:s}=await eY(i.auth,r);s!==e.email&&await e.reload()}async function tz(e,t,i){let r=(0,n.getModularInstance)(e),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};i&&tC(r.auth,s,i);let{email:a}=await eZ(r.auth,s);a!==e.email&&await e.reload()}async function tK(e,t){return N(e,"POST","/v1/accounts:update",t)}async function t$(e,{displayName:t,photoURL:i}){if(void 0===t&&void 0===i)return;let r=(0,n.getModularInstance)(e),s=await r.getIdToken(),a=await B(r,tK(r.auth,{idToken:s,displayName:t,photoUrl:i,returnSecureToken:!0}));r.displayName=a.displayName||null,r.photoURL=a.photoUrl||null;let o=r.providerData.find(({providerId:e})=>"password"===e);o&&(o.displayName=r.displayName,o.photoURL=r.photoURL),await r._updateTokensIfNecessary(a)}async function tB(e,t,i){let{auth:n}=e,r={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(r.email=t),i&&(r.password=i);let s=await B(e,ez(n,r));await e._updateTokensIfNecessary(s,!0)}class tJ{constructor(e,t,i={}){this.isNewUser=e,this.providerId=t,this.profile=i}}class tY extends tJ{constructor(e,t,i,n){super(e,t,i),this.username=n}}class tX extends tJ{constructor(e,t){super(e,"facebook.com",t)}}class tQ extends tY{constructor(e,t){super(e,"github.com",t,"string"==typeof(null==t?void 0:t.login)?null==t?void 0:t.login:null)}}class tZ extends tJ{constructor(e,t){super(e,"google.com",t)}}class t0 extends tY{constructor(e,t,i){super(e,"twitter.com",t,i)}}async function t1(e,t){return eS(e).validatePassword(t)}function t3(e,t,i,r){return(0,n.getModularInstance)(e).onIdTokenChanged(t,i,r)}function t2(e,t,i){return(0,n.getModularInstance)(e).beforeAuthStateChanged(t,i)}async function t4(e){return(0,n.getModularInstance)(e).delete()}class t5{constructor(e,t,i){this.type=e,this.credential=t,this.user=i}static _fromIdtoken(e,t){return new t5("enroll",e,t)}static _fromMfaPendingCredential(e){return new t5("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,i;if(null==e?void 0:e.multiFactorSession){if(null==(t=e.multiFactorSession)?void 0:t.pendingCredential)return t5._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);else if(null==(i=e.multiFactorSession)?void 0:i.idToken)return t5._fromIdtoken(e.multiFactorSession.idToken)}return null}}class t6{constructor(e,t,i){this.session=e,this.hints=t,this.signInResolver=i}static _fromError(e,t){let i=eS(e),n=t.customData._serverResponse,r=(n.mfaInfo||[]).map(e=>tN._fromServerResponse(i,e));I(n.mfaPendingCredential,i,"internal-error");let s=t5._fromMfaPendingCredential(n.mfaPendingCredential);return new t6(s,r,async e=>{let r=await e._process(i,s);delete n.mfaInfo,delete n.mfaPendingCredential;let a=Object.assign(Object.assign({},n),{idToken:r.idToken,refreshToken:r.refreshToken});switch(t.operationType){case"signIn":let o=await tp._fromIdTokenResponse(i,t.operationType,a);return await i._updateCurrentUser(o.user),o;case"reauthenticate":return I(t.user,i,"internal-error"),tp._forOperation(t.user,t.operationType,a);default:d(i,"internal-error")}})}async resolveSignIn(e){return this.signInResolver(e)}}function t8(e,t){return N(e,"POST","/v2/accounts/mfaEnrollment:start",P(e,t))}class t7{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(t=>tN._fromServerResponse(e.auth,t)))})}static _fromUser(e){return new t7(e)}async getSession(){return t5._fromIdtoken(await this.user.getIdToken(),this.user)}
1async enroll(e,t){let i=await this.getSession(),n=await B(this.user,e._process(this.user.auth,i,t));return await this.user._updateTokensIfNecessary(n),this.user.reload()}async unenroll(e){let t="string"==typeof e?e:e.uid,i=await this.user.getIdToken();try{var n,r;let e=await B(this.user,(n=this.user.auth,r={idToken:i,mfaEnrollmentId:t},N(n,"POST","/v2/accounts/mfaEnrollment:withdraw",P(n,r))));this.enrolledFactors=this.enrolledFactors.filter(({uid:e})=>e!==t),await this.user._updateTokensIfNecessary(e),await this.user.reload()}catch(e){throw e}}}let t9=new WeakMap,ie="__sak";class it{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(ie,"1"),this.storage.removeItem(ie),Promise.resolve(!0)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class ii extends it{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=ev(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let i=this.storage.getItem(t),n=this.localCache[t];i!==n&&e(t,n,i)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,i)=>{this.notifyListeners(e,i)});let i=e.key;t?this.detachListener():this.stopPolling();let r=()=>{let e=this.storage.getItem(i);(t||this.localCache[i]!==e)&&this.notifyListeners(i,e)},s=this.storage.getItem(i);(0,n.isIE)()&&10===document.documentMode&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;let i=this.listeners[e];if(i)for(let e of Array.from(i))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:i}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}function ir(e){var t,i;let n=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),r=RegExp(`${n}=([^;]+)`);return null!=(i=null==(t=document.cookie.match(r))?void 0:t[1])?i:null}function is(e){let t="http:"===window.location.protocol;return`${t?"__dev_":"__HOST-"}FIREBASE_${e.split(":")[3]}`}ii.type="LOCAL";class ia{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){let t=new URL(`${window.location.origin}/__cookies__`);return t.searchParams.set("finalTarget",e),t}async _isAvailable(){var e;return!("boolean"==typeof isSecureContext&&!isSecureContext||"u"<typeof navigator||"u"<typeof document)&&(null==(e=navigator.cookieEnabled)||e)}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;let t=is(e);if(window.cookieStore){let e=await window.cookieStore.get(t);return null==e?void 0:e.value}return ir(t)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;let t=is(e);document.cookie=`${t}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch("/__cookies__",{method:"DELETE"}).catch(()=>void 0)}_addListener(e,t){if(!this._isAvailable())return;let i=is(e);if(window.cookieStore){let e=e=>{let n=e.changed.find(e=>e.name===i);n&&t(n.value),e.deleted.find(e=>e.name===i)&&t(null)};return this.listenerUnsubscribes.set(t,()=>window.cookieStore.removeEventListener("change",e)),window.cookieStore.addEventListener("change",e)}let n=ir(i),r=setInterval(()=>{let e=ir(i);e!==n&&(t(e),n=e)},1e3);this.listenerUnsubscribes.set(t,()=>clearInterval(r))}_removeListener(e,t){let i=this.listenerUnsubscribes.get(t);i&&(i(),this.listenerUnsubscribes.delete(t))}}ia.type="COOKIE";class io extends it{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}io.type="SESSION";class il{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;let i=new il(e);return this.receivers.push(i),i}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let{eventId:t,eventType:i,data:n}=e.data,r=this.handlersMap[i];if(!(null==r?void 0:r.size))return;e.ports[0].postMessage({status:"ack",eventId:t,eventType:i});let s=Array.from(r).map(async t=>t(e.origin,n)),a=await Promise.all(s.map(async e=>{try{let t=await e;return{fulfilled:!0,value:t}}catch(e){return{fulfilled:!1,reason:e}}}));e.ports[0].postMessage({status:"done",eventId:t,eventType:i,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function ic(e="",t=10){let i="";for(let e=0;e<t;e++)i+=Math.floor(10*Math.random());return e+i}il.receivers=[];class iu{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,i=50){let n,r,s="u">typeof MessageChannel?new MessageChannel:null;if(!s)throw Error("connection_unavailable");return new Promise((a,o)=>{let l=ic("",20);s.port1.start();let c=setTimeout(()=>{o(Error("unsupported_event"))},i);r={messageChannel:s,onMessage(e){if(e.data.eventId===l)switch(e.data.status){case"ack":clearTimeout(c),n=setTimeout(()=>{o(Error("timeout"))},3e3);break;case"done":clearTimeout(n),a(e.data.response);break;default:clearTimeout(c),clearTimeout(n),o(Error("invalid_response"))}}},this.handlers.add(r),s.port1.addEventListener("message",r.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[s.port2])}).finally(()=>{r&&this.removeMessageHandler(r)})}}function id(){return window}
1function ih(){return void 0!==id().WorkerGlobalScope&&"function"==typeof id().importScripts}async function ip(){if(!(null==navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}let im="firebaseLocalStorageDb",ig="firebaseLocalStorage",iI="fbase_key";class i_{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 iv(e,t){return e.transaction([ig],t?"readwrite":"readonly").objectStore(ig)}function iT(){let e=indexedDB.open(im,1);return new Promise((t,i)=>{e.addEventListener("error",()=>{i(e.error)}),e.addEventListener("upgradeneeded",()=>{let t=e.result;try{t.createObjectStore(ig,{keyPath:iI})}catch(e){i(e)}}),e.addEventListener("success",async()=>{let i=e.result;i.objectStoreNames.contains(ig)?t(i):(i.close(),await new i_(indexedDB.deleteDatabase(im)).toPromise(),t(await iT()))})})}async function iE(e,t,i){return new i_(iv(e,!0).put({[iI]:t,value:i})).toPromise()}async function iy(e,t){let i=iv(e,!1).get(t),n=await new i_(i).toPromise();return void 0===n?null:n.value}function iw(e,t){return new i_(iv(e,!0).delete(t)).toPromise()}class iA{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await iT()),this.db}async _withRetries(e){let t=0;for(;;)try{let t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return ih()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=il._getInstance(ih()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await ip(),!this.activeServiceWorker)return;this.sender=new iu(this.activeServiceWorker);let i=await this.sender._send("ping",{},800);i&&(null==(e=i[0])?void 0:e.fulfilled)&&(null==(t=i[0])?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null==(t=null==navigator?void 0:navigator.serviceWorker)?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(e){}}async _isAvailable(){try{if(!indexedDB)return!1;let e=await iT();return await iE(e,ie,"1"),await iw(e,ie),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(i=>iE(i,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>iy(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>iw(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>new i_(iv(e,!1).getAll()).toPromise());if(!e||0!==this.pendingWrites)return[];let t=[],i=new Set;if(0!==e.length)for(let{fbase_key:n,value:r}of e)i.add(n),JSON.stringify(this.localCache[n])!==JSON.stringify(r)&&(this.notifyListeners(n,r),t.push(n));for(let e of Object.keys(this.localCache))this.localCache[e]&&!i.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;let i=this.listeners[e];if(i)for(let e of Array.from(i))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}function iS(e,t){return N(e,"POST","/v2/accounts/mfaSignIn:start",P(e,t))}iA.type="LOCAL";let iR=eN("rcb"),ik=new y(3e4,6e4);class iP{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(null==(e=id().grecaptcha)?void 0:e.render)}load(e,t=""){var i;return(I((i=t).length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(i),e,"argument-error"),this.shouldResolveImmediately(t)&&M(id().grecaptcha))?Promise.resolve(id().grecaptcha):new Promise((i,r)=>{let s=id().setTimeout(()=>{r(h(e,"network-request-failed"))},ik.get());id()[iR]=()=>{id().clearTimeout(s),delete id()[iR];let n=id().grecaptcha;if(!n||!M(n))return void r(h(e,"internal-error"));let a=n.render;n.render=(e,t)=>{let i=a(e,t);return this.counter++,i},this.hostLanguage=t,i(n)},eP(`${ek.recaptchaV2Script}?${(0,n.querystring)({onload:iR,render:"explicit",hl:t})}`).catch(()=>{clearTimeout(s),r(h(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!!(null==(t=id().grecaptcha)?void 0:t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class iN{async load(e){return new eb(e)}clearedOneInstance(){}}let ib="recaptcha",iO={theme:"light",type:"image"};class iC{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){let t=te._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function iD(e,t,r){if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(m(e));let s=eS(e);return new iC(await iU(s,t,(0,n.getModularInstance)(r)),e=>tA(s,e))}async function iL(e,t,i){let r=(0,n.getModularInstance)(e);return await tE(!1,r,"phone"),new iC(await iU(r.auth,t,(0,n.getModularInstance)(i)),e=>tS(r,e))}async function iM(e,t,r){let s=(0,n.getModularInstance)(e);return(0,i._isFirebaseServerApp)(s.auth.app)?Promise.reject(m(s.auth)):new iC(await iU(s.auth,t,(0,n.getModularInstance)(r)),e=>tR(s,e))}async function iU(e,t,i){var n;if(!e._getRecaptchaConfig())try{await eV(e)}catch(e){console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let r;if(r="string"==typeof t?{phoneNumber:t}
1:t,"session"in r){let t=r.session;if("phoneNumber"in r){I("enroll"===t.type,e,"internal-error");let n={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},s=async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===eL){I((null==i?void 0:i.type)===ib,e,"argument-error");let n=await iV(e,t,i);return t8(e,n)}return t8(e,t)},a=eF(e,n,"mfaSmsEnrollment",s,"PHONE_PROVIDER");return(await a.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{I("signin"===t.type,e,"internal-error");let s=(null==(n=r.multiFactorHint)?void 0:n.uid)||r.multiFactorUid;I(s,e,"missing-multi-factor-info");let a={mfaPendingCredential:t.credential,mfaEnrollmentId:s,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},o=async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===eL){I((null==i?void 0:i.type)===ib,e,"argument-error");let n=await iV(e,t,i);return iS(e,n)}return iS(e,t)},l=eF(e,a,"mfaSmsSignIn",o,"PHONE_PROVIDER");return(await l.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{let t={phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"},n=async(e,t)=>{if(t.captchaResponse===eL){I((null==i?void 0:i.type)===ib,e,"argument-error");let n=await iV(e,t,i);return e5(e,n)}return e5(e,t)},s=eF(e,t,"sendVerificationCode",n,"PHONE_PROVIDER");return(await s.catch(e=>Promise.reject(e))).sessionInfo}}finally{null==i||i._reset()}}async function iF(e,t){let r=(0,n.getModularInstance)(e);if((0,i._isFirebaseServerApp)(r.auth.app))return Promise.reject(m(r.auth));await tT(r,t)}async function iV(e,t,i){I(i.type===ib,e,"argument-error");let n=await i.verify();I("string"==typeof n,e,"argument-error");let r=Object.assign({},t);if("phoneEnrollmentInfo"in r){let e=r.phoneEnrollmentInfo.phoneNumber,t=r.phoneEnrollmentInfo.captchaResponse,i=r.phoneEnrollmentInfo.clientType,s=r.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(r,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:n,captchaResponse:t,clientType:i,recaptchaVersion:s}}),r}if(!("phoneSignInInfo"in r))return Object.assign(r,{recaptchaToken:n}),r;{let e=r.phoneSignInInfo.captchaResponse,t=r.phoneSignInInfo.clientType,i=r.phoneSignInInfo.recaptchaVersion;return Object.assign(r,{phoneSignInInfo:{recaptchaToken:n,captchaResponse:e,clientType:t,recaptchaVersion:i}}),r}}class ix{constructor(e){this.providerId=ix.PROVIDER_ID,this.auth=eS(e)}verifyPhoneNumber(e,t){return iU(this.auth,e,(0,n.getModularInstance)(t))}static credential(e,t){return te._fromVerification(e,t)}static credentialFromResult(e){return ix.credentialFromTaggedObject(e)}static credentialFromError(e){return ix.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:i}=e;return t&&i?te._fromTokenResponse(t,i):null}}function iH(e,t){return t?ea(t):(I(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}ix.PROVIDER_ID="phone",ix.PHONE_SIGN_IN_METHOD="phone";class ij extends eW{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return e2(e,this._buildIdpRequest())}_linkToIdToken(e,t){return e2(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return e2(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function iq(e){return tw(e.auth,new ij(e),e.bypassAuthState)}function iW(e){let{auth:t,user:i}=e;return I(i,t,"internal-error"),ty(i,new ij(e),e.bypassAuthState)}async function iG(e){let{auth:t,user:i}=e;return I(i,t,"internal-error"),tT(i,new ij(e),e.bypassAuthState)}class iz{constructor(e,t,i,n,r=!1){this.auth=e,this.resolver=i,this.user=n,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:i,postBody:n,tenantId:r,error:s,type:a}=e;if(s)return void this.reject(s);let o={auth:this.auth,requestUri:t,sessionId:i,tenantId:r||void 0,postBody:n||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(o))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return iq;case"linkViaPopup":case"linkViaRedirect":return iG;case"reauthViaPopup":case"reauthViaRedirect":return iW;default:d(this.auth,"internal-error")}}resolve(e){var t,i;t=this.pendingPromise,i="Pending promise was never set",t||_(i),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){var t,i;t=this.pendingPromise,i="Pending promise was never set",t||_(i),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}let iK=new y(2e3,1e4);async function i$(e,t,n){if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(h(e,"operation-not-supported-in-this-environment"));let r=eS(e);f(e,t,tn);let s=iH(r,n);return new iY(r,"signInViaPopup",t,s).executeNotNull()}async function iB(e,t,r){let s=(0,n.getModularInstance)(e);if((0,i._isFirebaseServerApp)(s.auth.app))return Promise.reject(h(s.auth,"operation-not-supported-in-this-environment"));f(s.auth,t,tn);let a=iH(s.auth,r);return new iY(s.auth,"reauthViaPopup",t,a,s).executeNotNull()}async function iJ(e,t,i){let r=(0,n.getModularInstance)(e);f(r.auth,t,tn);let s=iH(r.auth,i);return new iY(r.auth,"linkViaPopup",t,s,r).executeNotNull()}class iY extends iz{constructor(e,t,i,n,r){super(e,t,n,r),this.provider=i,this.authWindow=null,this.pollId=null,iY.currentPopupAction&&iY.currentPopupAction.cancel(),iY.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return I(e,this.auth,"internal-error"),e}async onExecution(){var e,t;e=1===this.filter.length,t="Popup operations only handle one event",e||_(t);let i=ic();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],i),this.authWindow.associatedEvent=i,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(h(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null==(e=this.authWindow)?void 0:e.associatedEvent)||null}cancel(){this.reject(h(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,iY.currentPopupAction=null}pollUserCancellation(){let e=()=>{var t,i;if(null==(i=null==(t=this.authWindow)?void 0:t.window)?void 0:i.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(h(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,iK.get())};e()}}iY.currentPopupAction=null;let iX=new Map;class iQ extends iz{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}async execute(){let e=iX.get(this.auth._key());if(!e){try{let t=await iZ(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}iX.set(this.auth._key(),e)}return this.bypassAuthState||iX.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);
1if("unknown"===e.type)return void this.resolve(null);if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function iZ(e,t){let i=i2(t),n=i3(e);if(!await n._isAvailable())return!1;let r=await n._get(i)==="true";return await n._remove(i),r}async function i0(e,t){return i3(e)._set(i2(t),"true")}function i1(e,t){iX.set(e._key(),t)}function i3(e){return ea(e._redirectPersistence)}function i2(e){return el("pendingRedirect",e.config.apiKey,e.name)}async function i4(e,t,n){if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(m(e));let r=eS(e);f(e,t,tn),await r._initializationPromise;let s=iH(r,n);return await i0(s,r),s._openRedirect(r,t,"signInViaRedirect")}async function i5(e,t,r){let s=(0,n.getModularInstance)(e);if(f(s.auth,t,tn),(0,i._isFirebaseServerApp)(s.auth.app))return Promise.reject(m(s.auth));await s.auth._initializationPromise;let a=iH(s.auth,r);await i0(a,s.auth);let o=await i9(s);return a._openRedirect(s.auth,t,"reauthViaRedirect",o)}async function i6(e,t,i){let r=(0,n.getModularInstance)(e);f(r.auth,t,tn),await r.auth._initializationPromise;let s=iH(r.auth,i);await tE(!1,r,t.providerId),await i0(s,r.auth);let a=await i9(r);return s._openRedirect(r.auth,t,"linkViaRedirect",a)}async function i8(e,t){return await eS(e)._initializationPromise,i7(e,t,!1)}async function i7(e,t,n=!1){if((0,i._isFirebaseServerApp)(e.app))return Promise.reject(m(e));let r=eS(e),s=iH(r,t),a=new iQ(r,s,n),o=await a.execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,t)),o}async function i9(e){let t=ic(`${e.uid}:::`);return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}class ne{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(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return ni(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var i;if(e.error&&!ni(e)){let n=(null==(i=e.error.code)?void 0:i.split("auth/")[1])||"internal-error";t.onError(h(this.auth,n))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let i=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(nt(e))}saveEventToCache(e){this.cachedEventUids.add(nt(e)),this.lastProcessedEventTime=Date.now()}}function nt(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function ni({type:e,error:t}){return"unknown"===e&&(null==t?void 0:t.code)==="auth/no-auth-event"}async function nn(e,t={}){return N(e,"GET","/v1/projects",t)}let nr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ns=/^https?/;async function na(e){if(e.config.emulator)return;let{authorizedDomains:t}=await nn(e);for(let e of t)try{if(function(e){let t=v(),{protocol:i,hostname:n}=new URL(t);if(e.startsWith("chrome-extension://")){let r=new URL(e);return""===r.hostname&&""===n?"chrome-extension:"===i&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===i&&r.hostname===n}if(!ns.test(i))return!1;if(nr.test(e))return n===e;let r=e.replace(/\./g,"\\.");return RegExp("^(.+\\."+r+"|"+r+")$","i").test(n)}(e))return}catch(e){}d(e,"unauthorized-domain")}let no=new y(3e4,6e4);function nl(){let e=id().___jsl;if(null==e?void 0:e.H){for(let t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}}let nc=null,nu=new y(5e3,15e3),nd={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},nh=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);async function np(e){let t,r,s,a,o,l=await (nc=nc||new Promise((t,i)=>{var n,r,s;function a(){nl(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{nl(),i(h(e,"network-request-failed"))},timeout:no.get()})}if(null==(r=null==(n=id().gapi)?void 0:n.iframes)?void 0:r.Iframe)t(gapi.iframes.getContext());else if(null==(s=id().gapi)?void 0:s.load)a();else{let t=eN("iframefcb");return id()[t]=()=>{gapi.load?a():i(h(e,"network-request-failed"))},eP(`${ek.gapiScript}?onload=${t}`).catch(e=>i(e))}}).catch(e=>{throw nc=null,e})),c=id().gapi;return I(c,e,"internal-error"),l.open({where:document.body,url:(I((t=e.config).authDomain,e,"auth-domain-config-required"),r=t.emulator?w(t,"emulator/auth/iframe"):`https://${e.config.authDomain}
1/__/auth/iframe`,s={apiKey:t.apiKey,appName:e.name,v:i.SDK_VERSION},(a=nh.get(e.config.apiHost))&&(s.eid=a),(o=e._getFrameworks()).length&&(s.fw=o.join(",")),`${r}?${(0,n.querystring)(s).slice(1)}`),messageHandlersFilter:c.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:nd,dontclear:!0},t=>new Promise(async(i,n)=>{await t.restyle({setHideOnLeave:!1});let r=h(e,"network-request-failed"),s=id().setTimeout(()=>{n(r)},nu.get());function a(){id().clearTimeout(s),i(t)}t.ping(a).then(a,()=>{n(r)})}))}let nm={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class nf{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}let ng=encodeURIComponent("fac");async function nI(e,t,r,s,a,o){I(e.config.authDomain,e,"auth-domain-config-required"),I(e.config.apiKey,e,"invalid-api-key");let l={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:s,v:i.SDK_VERSION,eventId:a};if(t instanceof tn)for(let[i,r]of(t.setDefaultLanguage(e.languageCode),l.providerId=t.providerId||"",(0,n.isEmpty)(t.getCustomParameters())||(l.customParameters=JSON.stringify(t.getCustomParameters())),Object.entries(o||{})))l[i]=r;if(t instanceof tr){let e=t.getScopes().filter(e=>""!==e);e.length>0&&(l.scopes=e.join(","))}for(let t of(e.tenantId&&(l.tid=e.tenantId),Object.keys(l)))void 0===l[t]&&delete l[t];let c=await e._getAppCheckToken(),u=c?`#${ng}=${encodeURIComponent(c)}`:"";return`${function({config:e}){return e.emulator?w(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${(0,n.querystring)(l).slice(1)}${u}`}let n_="webStorageSupport",nv=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=io,this._completeRedirectFn=i7,this._overrideRedirectResult=i1}async _openPopup(e,t,i,r){var s,a,o;a=null==(s=this.eventManagers[e._key()])?void 0:s.manager,o="_initialize() not called before _openPopup()",a||_(o);let l=await nI(e,t,i,v(),r);return function(e,t,i,r=500,s=600){let a=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString(),l="",c=Object.assign(Object.assign({},nm),{width:r.toString(),height:s.toString(),top:a,left:o}),u=(0,n.getUA)().toLowerCase();i&&(l=ep(u)?"_blank":i),ed(u)&&(t=t||"http://localhost",c.scrollbars="yes");let d=Object.entries(c).reduce((e,[t,i])=>`${e}${t}=${i},`,"");if(function(e=(0,n.getUA)()){var t;return e_(e)&&!!(null==(t=window.navigator)?void 0:t.standalone)}(u)&&"_self"!==l){var h,p;let e,i;return h=t||"",p=l,(e=document.createElement("a")).href=h,e.target=p,(i=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),e.dispatchEvent(i),new nf(null)}let m=window.open(t||"",l,d);I(m,e,"popup-blocked");try{m.focus()}catch(e){}return new nf(m)}(e,l,ic())}async _openRedirect(e,t,i,n){var r;return await this._originValidation(e),r=await nI(e,t,i,v(),n),id().location.href=r,new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){var i;let{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(i="If manager is not set, promise should be",n||_(i),n)}let n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){let t=await np(e),i=new ne(e);return t.register("authEvent",t=>(I(null==t?void 0:t.authEvent,e,"invalid-auth-event"),{status:i.onEvent(t.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(n_,{type:n_},i=>{var n;let r=null==(n=null==i?void 0:i[0])?void 0:n[n_];void 0!==r&&t(!!r),d(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=na(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ev()||eh()||e_()}};class nT{constructor(e){this.factorId=e}_process(e,t,i){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,i);case"signin":return this._finalizeSignIn(e,t.credential);default:return _("unexpected MultiFactorSessionType")}}}class nE extends nT{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new nE(e)}_finalizeEnroll(e,t,i){return N(e,"POST","/v2/accounts/mfaEnrollment:finalize",P(e,{idToken:t,displayName:i,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(e,t){return N(e,"POST","/v2/accounts/mfaSignIn:finalize",P(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}}class ny{static assertion(e){return nE._fromCredential(e)}}ny.FACTOR_ID="phone";class nw{static assertionForEnrollment(e,t){return nA._fromSecret(e,t)}static assertionForSignIn(e,t){return nA._fromEnrollmentId(e,t)}static async generateSecret(e){var t,i;I(void 0!==(null==(t=e.user)?void 0:t.auth),"internal-error");let n=await N(i=e.user.auth,"POST","/v2/accounts/mfaEnrollment:start",P(i,{idToken:e.credential,totpEnrollmentInfo:{}}));return nS._fromStartTotpMfaEnrollmentResponse(n,e.user.auth)}}nw.FACTOR_ID="totp";class nA extends nT{constructor(e,t,i){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=i}
1static _fromSecret(e,t){return new nA(t,void 0,e)}static _fromEnrollmentId(e,t){return new nA(t,e)}async _finalizeEnroll(e,t,i){return I(void 0!==this.secret,e,"argument-error"),N(e,"POST","/v2/accounts/mfaEnrollment:finalize",P(e,{idToken:t,displayName:i,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)}))}async _finalizeSignIn(e,t){I(void 0!==this.enrollmentId&&void 0!==this.otp,e,"argument-error");let i={verificationCode:this.otp};return N(e,"POST","/v2/accounts/mfaSignIn:finalize",P(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:i}))}}class nS{constructor(e,t,i,n,r,s,a){this.sessionInfo=s,this.auth=a,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=i,this.codeIntervalSeconds=n,this.enrollmentCompletionDeadline=r}static _fromStartTotpMfaEnrollmentResponse(e,t){return new nS(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 n=!1;return(nR(e)||nR(t))&&(n=!0),n&&(nR(e)&&(e=(null==(i=this.auth.currentUser)?void 0:i.email)||"unknownuser"),nR(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function nR(e){return void 0===e||(null==e?void 0:e.length)===0}var nk="@firebase/auth",nP="1.10.8";class nN{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null==(e=this.auth.currentUser)?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;let t=this.auth.onIdTokenChanged(t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){I(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}let nb=(0,n.getExperimentalSetting)("authIdTokenMaxAge")||300,nO=null;ek={loadJS:e=>new Promise((t,i)=>{var n,r;let s=document.createElement("script");s.setAttribute("src",e),s.onload=t,s.onerror=e=>{let t=h("internal-error");t.customData=e,i(t)},s.type="text/javascript",s.charset="UTF-8",(null!=(r=null==(n=document.getElementsByTagName("head"))?void 0:n[0])?r:document).appendChild(s)}),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="},t="Browser",(0,i._registerComponent)(new a.Component("auth",(e,{options:i})=>{let n,r,s=e.getProvider("app").getImmediate(),a=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:l,authDomain:c}=s.options;I(l&&!l.includes(":"),"invalid-api-key",{appName:s.name});let u=new eA(s,a,o,{apiKey:l,authDomain:c,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:eT(t)});return r=(Array.isArray(n=(null==i?void 0:i.persistence)||[])?n:[n]).map(ea),(null==i?void 0:i.errorMap)&&u._updateErrorMap(i.errorMap),u._initializeWithPersistence(r,null==i?void 0:i.popupRedirectResolver),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),(0,i._registerComponent)(new a.Component("auth-internal",e=>new nN(eS(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,i.registerVersion)(nk,nP,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(t)),(0,i.registerVersion)(nk,nP,"esm2017"),e.s(["$",0,tu,"A",0,{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"},"B",0,function(e){(0,n.getModularInstance)(e).useDeviceLanguage()},"C",0,function(e,t){return(0,n.getModularInstance)(e).updateCurrentUser(t)},"D",0,function(e){return(0,n.getModularInstance)(e).signOut()},"E",0,function(e,t){return eS(e).revokeAccessToken(t)},"F",0,{PHONE:"phone",TOTP:"totp"},"G",0,t4,"H",0,function
vendor: 12,062 bytes, line 1
1(){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`)."}},
1"I",0,o,"J",0,{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_
1NONCE:"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_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"},"K",0,ex,"L",0,eH,"M",0,eW,"N",0,e3,"O",0,{LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},"P",0,ix,"Q",0,e4,"R",0,class{constructor(e,t,i=Object.assign({},iO)){this.parameters=i,this.type=ib,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=eS(e),this.isInvisible="invisible"===this.parameters.size,I("u">typeof document,this.auth,"operation-not-supported-in-this-environment");const n="string"==typeof t?document.getElementById(t):t;I(n,this.auth,"argument-error"),this.container=n,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new iN:new iP,this.validateStartingState()}async verify(){this.assertNotDestroyed();let e=await this.render(),t=this.getAssertedRecaptcha(),i=t.getResponse(e);return i||new Promise(i=>{let n=e=>{e&&(this.tokenChangeListeners.delete(n),i(e))};this.tokenChangeListeners.add(n),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e})),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){I(!this.parameters.sitekey,this.auth,"argument-error"),I(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),I("u">typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>
1{if(this.tokenChangeListeners.forEach(e=>e(t)),"function"==typeof e)e(t);else if("string"==typeof e){let i=id()[e];"function"==typeof i&&i(t)}}}assertNotDestroyed(){I(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){let e;I(T()&&!ih(),this.auth,"internal-error"),await (e=null,new Promise(t=>{"complete"===document.readyState?t():(e=()=>t(),window.addEventListener("load",e))}).catch(t=>{throw e&&window.removeEventListener("load",e),t})),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let t=await V(this.auth);I(t,this.auth,"internal-error"),this.parameters.sitekey=t}getAssertedRecaptcha(){return I(this.recaptcha,this.auth,"internal-error"),this.recaptcha}},"S",0,{EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},"T",0,nw,"U",0,te,"V",0,eo,"W",0,ti,"X",0,ta,"Y",0,to,"Z",0,tl,"_",0,ts,"a",0,ia,"a0",0,td,"a1",0,tf,"a2",0,tA,"a3",0,tS,"a4",0,tR,"a5",0,tP,"a6",0,tL,"a7",0,tM,"a8",0,tU,"a9",0,tF,"aa",0,tV,"ab",0,tx,"ac",0,function(e,t,r){return(0,i._isFirebaseServerApp)(e.app)?Promise.reject(m(e)):tA((0,n.getModularInstance)(e),ti.credential(t,r)).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&tD(e),t})},"ad",0,tH,"ae",0,function(e,t){let i=tt.parseLink(t);return(null==i?void 0:i.operation)==="EMAIL_SIGNIN"},"af",0,tj,"ag",0,tW,"ah",0,tG,"ai",0,tz,"aj",0,tt,"ak",0,function(e){return tt.parseLink(e)},"al",0,t$,"am",0,function(e,t){let r=(0,n.getModularInstance)(e);return(0,i._isFirebaseServerApp)(r.auth.app)?Promise.reject(m(r.auth)):tB(r,t,null)},"an",0,function(e,t){return tB((0,n.getModularInstance)(e),null,t)},"ao",0,function(e,t=!1){return(0,n.getModularInstance)(e).getIdToken(t)},"ap",0,G,"aq",0,tv,"ar",0,function(e){let{user:t,_tokenResponse:i}=e;return t.isAnonymous&&!i?{providerId:null,isNewUser:!1,profile:null}:function(e){var t,i;if(!e)return null;let{providerId:n}=e,r=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},s=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!n&&(null==e?void 0:e.idToken)){let n=null==(i=null==(t=K(e.idToken))?void 0:t.firebase)?void 0:i.sign_in_provider;if(n)return new tJ(s,"anonymous"!==n&&"custom"!==n?n:null)}if(!n)return null;switch(n){case"facebook.com":return new tX(s,r);case"github.com":return new tQ(s,r);case"google.com":return new tZ(s,r);case"twitter.com":return new t0(s,r,e.screenName||null);case"custom":case"anonymous":return new tJ(s,null);default:return new tJ(s,n,r)}}(i)},"as",0,Q,"at",0,function(e,t){var i;let r=(0,n.getModularInstance)(e);return I(t.customData.operationType,r,"argument-error"),I(null==(i=t.customData._serverResponse)?void 0:i.mfaPendingCredential,r,"argument-error"),t6._fromError(r,t)},"au",0,function(e){let t=(0,n.getModularInstance)(e);return t9.has(t)||t9.set(t,t7._fromUser(t)),t9.get(t)},"b",0,ii,"c",0,io,"d",0,i$,"e",0,iJ,"f",0,iB,"g",0,function(e,t,i){return i4(e,t,i)},"h",0,function(e,t,i){return i6(e,t,i)},"i",0,iA,"j",0,function(e,t,i){return i5(e,t,i)},"k",0,i8,"l",0,iL,"m",0,nv,"n",0,ny,"o",0,nS,"p",0,function(e=(0,i.getApp)()){let t=(0,i._getProvider)(e,"auth");if(t.isInitialized())return t.getImmediate();let r=ex(e,{popupRedirectResolver:nv,persistence:[iA,ii,io]}),s=(0,n.getExperimentalSetting)("authTokenSyncURL");if(s&&"boolean"==typeof isSecureContext&&isSecureContext){let e=new URL(s,location.origin);if(location.origin===e.origin){let t,i=(t=e.toString(),async e=>{let i=e&&await e.getIdTokenResult(),n=i&&(new Date().getTime()-Date.parse(i.issuedAtTime))/1e3;if(n&&n>nb)return;let r=null==i?void 0:i.token;nO!==r&&(nO=r,await fetch(t,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))});t2(r,i,()=>i(r.currentUser)),t3(r,e=>i(e))}}let a=(0,n.getDefaultEmulatorHost)("auth");return a&&eH(r,`http://${a}`),r},"q",0,{FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},"r",0,iM,"s",0,iD,"t",0,function(e,t){return(0,n.getModularInstance)(e).setPersistence(t)},"u",0,iF,"v",0,function(e){return eV(e)},"w",0,t1,"x",0,t3,"y",0,t2,"z",0,function(e,t,i,r){return(0,n.getModularInstance)(e).onAuthStateChanged(t,i,r)}],544073),e.s([],648591),e.s([],151718)}]);
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.