-
Notifications
You must be signed in to change notification settings - Fork 0
/
2644.c5f393a3c805c1f5.js
1 lines (1 loc) · 134 KB
/
2644.c5f393a3c805c1f5.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[2644],{32644:($u,Hi,M)=>{M.r(Hi);var a=M(15861),ze=M(63942),l=M(42090),b=M(6881),Ge=M(97582),qe=M(41877),$e=M(34859);const se={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},B_EMAIL_SIGNIN="EMAIL_SIGNIN",B_PASSWORD_RESET="PASSWORD_RESET",B_RECOVER_EMAIL="RECOVER_EMAIL",B_REVERT_SECOND_FACTOR_ADDITION="REVERT_SECOND_FACTOR_ADDITION",B_VERIFY_AND_CHANGE_EMAIL="VERIFY_AND_CHANGE_EMAIL",B_VERIFY_EMAIL="VERIFY_EMAIL";const Gi=function zi(){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 registed 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 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."}},qi=function mr(){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."}},_r=new l.LL("auth","Firebase",{"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."}),Re=new qe.Yd("@firebase/auth");function Ae(n,...e){Re.logLevel<=qe.in.ERROR&&Re.error(`Auth (${b.SDK_VERSION}): ${n}`,...e)}function y(n,...e){throw Be(n,...e)}function E(n,...e){return Be(n,...e)}function gr(n,e,t){const r=Object.assign(Object.assign({},qi()),{[e]:t});return new l.LL("auth","Firebase",r).create(e,{appName:n.name})}function K(n,e,t){if(!(e instanceof t))throw t.name!==e.constructor.name&&y(n,"argument-error"),gr(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Be(n,...e){if("string"!=typeof n){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return _r.create(n,...e)}function d(n,e,...t){if(!n)throw Be(e,...t)}function N(n){const e="INTERNAL ASSERTION FAILED: "+n;throw Ae(e),new Error(e)}function P(n,e){n||N(e)}function oe(){var n;return typeof self<"u"&&(null===(n=self.location)||void 0===n?void 0:n.href)||""}function Ke(){return"http:"===vr()||"https:"===vr()}function vr(){var n;return typeof self<"u"&&(null===(n=self.location)||void 0===n?void 0:n.protocol)||null}class ae{constructor(e,t){this.shortDelay=e,this.longDelay=t,P(t>e,"Short delay should be less than long delay!"),this.isMobile=(0,l.uI)()||(0,l.b$)()}get(){return function Bi(){return!(typeof navigator<"u"&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(Ke()||(0,l.ru)()||"connection"in navigator))||navigator.onLine}()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function je(n,e){P(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}class Ir{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){return this.fetchImpl?this.fetchImpl:typeof self<"u"&&"fetch"in self?self.fetch:void N("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:typeof self<"u"&&"Headers"in self?self.Headers:void N("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:typeof self<"u"&&"Response"in self?self.Response:void N("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const ji={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",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",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Yi=new ae(3e4,6e4);function m(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}function g(n,e,t,r){return Ye.apply(this,arguments)}function Ye(){return(Ye=(0,a.Z)(function*(n,e,t,r,i={}){return yr(n,i,(0,a.Z)(function*(){let s={},o={};r&&("GET"===e?o=r:s={body:JSON.stringify(r)});const u=(0,l.xO)(Object.assign({key:n.config.apiKey},o)).slice(1),c=yield n._getAdditionalHeaders();return c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode),Ir.fetch()(Er(n,n.config.apiHost,t,u),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},s))}))})).apply(this,arguments)}function yr(n,e,t){return Je.apply(this,arguments)}function Je(){return(Je=(0,a.Z)(function*(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},ji),e);try{const i=new Ji(n),s=yield Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=yield s.json();if("needConfirmation"in o)throw ue(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const u=s.ok?o.errorMessage:o.error.message,[c,h]=u.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===c)throw ue(n,"credential-already-in-use",o);if("EMAIL_EXISTS"===c)throw ue(n,"email-already-in-use",o);if("USER_DISABLED"===c)throw ue(n,"user-disabled",o);const f=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(h)throw gr(n,f,h);y(n,f)}}catch(i){if(i instanceof l.ZR)throw i;y(n,"network-request-failed",{message:String(i)})}})).apply(this,arguments)}function C(n,e,t,r){return Xe.apply(this,arguments)}function Xe(){return(Xe=(0,a.Z)(function*(n,e,t,r,i={}){const s=yield g(n,e,t,r,i);return"mfaPendingCredential"in s&&y(n,"multi-factor-auth-required",{_serverResponse:s}),s})).apply(this,arguments)}function Er(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?je(n.config,i):`${n.config.apiScheme}://${i}`}class Ji{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(E(this.auth,"network-request-failed")),Yi.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ue(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=E(n,e,r);return i.customData._tokenResponse=t,i}function Qe(){return(Qe=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:delete",e)})).apply(this,arguments)}function et(){return(et=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:update",e)})).apply(this,arguments)}function tt(){return(tt=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:lookup",e)})).apply(this,arguments)}function ce(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function nt(){return(nt=(0,a.Z)(function*(n,e=!1){const t=(0,l.m9)(n),r=yield t.getIdToken(e),i=ke(r);d(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const s="object"==typeof i.firebase?i.firebase:void 0,o=null==s?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:ce(rt(i.auth_time)),issuedAtTime:ce(rt(i.iat)),expirationTime:ce(rt(i.exp)),signInProvider:o||null,signInSecondFactor:(null==s?void 0:s.sign_in_second_factor)||null}})).apply(this,arguments)}function rt(n){return 1e3*Number(n)}function ke(n){const[e,t,r]=n.split(".");if(void 0===e||void 0===t||void 0===r)return Ae("JWT malformed, contained fewer than 3 sections"),null;try{const i=(0,l.tV)(t);return i?JSON.parse(i):(Ae("Failed to decode base64 JWT payload"),null)}catch(i){return Ae("Caught error parsing JWT payload as JSON",null==i?void 0:i.toString()),null}}function O(n,e){return it.apply(this,arguments)}function it(){return(it=(0,a.Z)(function*(n,e,t=!1){if(t)return e;try{return yield e}catch(r){throw r instanceof l.ZR&&function rs({code:n}){return"auth/user-disabled"===n||"auth/user-token-expired"===n}(r)&&n.auth.currentUser===n&&(yield n.auth.signOut()),r}})).apply(this,arguments)}class is{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){const r=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),r}{this.errorBackoff=3e4;const i=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){var t=this;if(!this.isRunning)return;const r=this.getInterval(e);this.timerId=setTimeout((0,a.Z)(function*(){yield t.iteration()}),r)}iteration(){var e=this;return(0,a.Z)(function*(){try{yield e.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===(null==t?void 0:t.code)&&e.schedule(!0))}e.schedule()})()}}class Tr{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=ce(this.lastLoginAt),this.creationTime=ce(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}function le(n){return st.apply(this,arguments)}function st(){return st=(0,a.Z)(function*(n){var e;const t=n.auth,r=yield n.getIdToken(),i=yield O(n,function es(n,e){return tt.apply(this,arguments)}(t,{idToken:r}));d(null==i?void 0:i.users.length,t,"internal-error");const s=i.users[0];n._notifyReloadListener(s);const o=null!==(e=s.providerUserInfo)&&void 0!==e&&e.length?function as(n){return n.map(e=>{var{providerId:t}=e,r=(0,Ge._T)(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}(s.providerUserInfo):[],u=function os(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}(n.providerData,o),f=!!n.isAnonymous&&!(n.email&&s.passwordHash||null!=u&&u.length),p={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:u,metadata:new Tr(s.createdAt,s.lastLoginAt),isAnonymous:f};Object.assign(n,p)}),st.apply(this,arguments)}function ot(){return(ot=(0,a.Z)(function*(n){const e=(0,l.m9)(n);yield le(e),yield e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)})).apply(this,arguments)}function at(){return(at=(0,a.Z)(function*(n,e){const t=yield yr(n,{},(0,a.Z)(function*(){const r=(0,l.xO)({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=n.config,o=Er(n,i,"/v1/token",`key=${s}`),u=yield n._getAdditionalHeaders();return u["Content-Type"]="application/x-www-form-urlencoded",Ir.fetch()(o,{method:"POST",headers:u,body:r})}));return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}})).apply(this,arguments)}class de{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){d(e.idToken,"internal-error"),d(typeof e.idToken<"u","internal-error"),d(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):function ns(n){const e=ke(n);return d(e,"internal-error"),d(typeof e.exp<"u","internal-error"),d(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}getToken(e,t=!1){var r=this;return(0,a.Z)(function*(){return d(!r.accessToken||r.refreshToken,e,"user-token-expired"),t||!r.accessToken||r.isExpired?r.refreshToken?(yield r.refresh(e,r.refreshToken),r.accessToken):null:r.accessToken})()}clearRefreshToken(){this.refreshToken=null}refresh(e,t){var r=this;return(0,a.Z)(function*(){const{accessToken:i,refreshToken:s,expiresIn:o}=yield function us(n,e){return at.apply(this,arguments)}(e,t);r.updateTokensAndExpiration(i,s,Number(o))})()}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*r}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:s}=t,o=new de;return r&&(d("string"==typeof r,"internal-error",{appName:e}),o.refreshToken=r),i&&(d("string"==typeof i,"internal-error",{appName:e}),o.accessToken=i),s&&(d("number"==typeof s,"internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new de,this.toJSON())}_performRefresh(){return N("not implemented")}}function U(n,e){d("string"==typeof n||typeof n>"u","internal-error",{appName:e})}class W{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=(0,Ge._T)(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new is(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Tr(s.createdAt||void 0,s.lastLoginAt||void 0)}getIdToken(e){var t=this;return(0,a.Z)(function*(){const r=yield O(t,t.stsTokenManager.getToken(t.auth,e));return d(r,t.auth,"internal-error"),t.accessToken!==r&&(t.accessToken=r,yield t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)),r})()}getIdTokenResult(e){return function ts(n){return nt.apply(this,arguments)}(this,e)}reload(){return function ss(n){return ot.apply(this,arguments)}(this)}_assign(e){this!==e&&(d(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(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new W(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){d(!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()}_updateTokensIfNecessary(e,t=!1){var r=this;return(0,a.Z)(function*(){let i=!1;e.idToken&&e.idToken!==r.stsTokenManager.accessToken&&(r.stsTokenManager.updateFromServerResponse(e),i=!0),t&&(yield le(r)),yield r.auth._persistUserIfCurrent(r),i&&r.auth._notifyListenersIfCurrent(r)})()}delete(){var e=this;return(0,a.Z)(function*(){const t=yield e.getIdToken();return yield O(e,function Xi(n,e){return Qe.apply(this,arguments)}(e.auth,{idToken:t})),e.stsTokenManager.clearRefreshToken(),e.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 r,i,s,o,u,c,h,f;const p=null!==(r=t.displayName)&&void 0!==r?r:void 0,_=null!==(i=t.email)&&void 0!==i?i:void 0,S=null!==(s=t.phoneNumber)&&void 0!==s?s:void 0,He=null!==(o=t.photoURL)&&void 0!==o?o:void 0,Mi=null!==(u=t.tenantId)&&void 0!==u?u:void 0,dr=null!==(c=t._redirectEventId)&&void 0!==c?c:void 0,Ui=null!==(h=t.createdAt)&&void 0!==h?h:void 0,Fi=null!==(f=t.lastLoginAt)&&void 0!==f?f:void 0,{uid:hr,emailVerified:Vi,isAnonymous:Zi,providerData:fr,stsTokenManager:Wi}=t;d(hr&&Wi,e,"internal-error");const Gu=de.fromJSON(this.name,Wi);d("string"==typeof hr,e,"internal-error"),U(p,e.name),U(_,e.name),d("boolean"==typeof Vi,e,"internal-error"),d("boolean"==typeof Zi,e,"internal-error"),U(S,e.name),U(He,e.name),U(Mi,e.name),U(dr,e.name),U(Ui,e.name),U(Fi,e.name);const pr=new W({uid:hr,auth:e,email:_,emailVerified:Vi,displayName:p,isAnonymous:Zi,photoURL:He,phoneNumber:S,tenantId:Mi,stsTokenManager:Gu,createdAt:Ui,lastLoginAt:Fi});return fr&&Array.isArray(fr)&&(pr.providerData=fr.map(qu=>Object.assign({},qu))),dr&&(pr._redirectEventId=dr),pr}static _fromIdTokenResponse(e,t,r=!1){return(0,a.Z)(function*(){const i=new de;i.updateFromServerResponse(t);const s=new W({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return yield le(s),s})()}}const Rr=new Map;function R(n){P(n instanceof Function,"Expected a class definition");let e=Rr.get(n);return e?(P(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,Rr.set(n,e),e)}const j=(()=>{class n{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return(0,a.Z)(function*(){return!0})()}_set(t,r){var i=this;return(0,a.Z)(function*(){i.storage[t]=r})()}_get(t){var r=this;return(0,a.Z)(function*(){const i=r.storage[t];return void 0===i?null:i})()}_remove(t){var r=this;return(0,a.Z)(function*(){delete r.storage[t]})()}_addListener(t,r){}_removeListener(t,r){}}return n.type="NONE",n})();function H(n,e,t){return`firebase:${n}:${e}:${t}`}class Y{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=H(this.userKey,i.apiKey,s),this.fullPersistenceKey=H("persistence",i.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}getCurrentUser(){var e=this;return(0,a.Z)(function*(){const t=yield e.persistence._get(e.fullUserKey);return t?W._fromJSON(e.auth,t):null})()}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(e){var t=this;return(0,a.Z)(function*(){if(t.persistence===e)return;const r=yield t.getCurrentUser();return yield t.removeCurrentUser(),t.persistence=e,r?t.setCurrentUser(r):void 0})()}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(e,t,r="authUser"){return(0,a.Z)(function*(){if(!t.length)return new Y(R(j),e,r);const i=(yield Promise.all(t.map(function(){var h=(0,a.Z)(function*(f){if(yield f._isAvailable())return f});return function(f){return h.apply(this,arguments)}}()))).filter(h=>h);let s=i[0]||R(j);const o=H(r,e.config.apiKey,e.name);let u=null;for(const h of t)try{const f=yield h._get(o);if(f){const p=W._fromJSON(e,f);h!==s&&(u=p),s=h;break}}catch{}const c=i.filter(h=>h._shouldAllowMigration);return s._shouldAllowMigration&&c.length?(s=c[0],u&&(yield s._set(o,u.toJSON())),yield Promise.all(t.map(function(){var h=(0,a.Z)(function*(f){if(f!==s)try{yield f._remove(o)}catch{}});return function(f){return h.apply(this,arguments)}}())),new Y(s,e,r)):new Y(s,e,r)})()}}function Ar(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Sr(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(kr(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Nr(e))return"Blackberry";if(wr(e))return"Webos";if(ut(e))return"Safari";if((e.includes("chrome/")||Pr(e))&&!e.includes("edge/"))return"Chrome";if(he(e))return"Android";{const r=n.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(2===(null==r?void 0:r.length))return r[1]}return"Other"}function kr(n=(0,l.z$)()){return/firefox\//i.test(n)}function ut(n=(0,l.z$)()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Pr(n=(0,l.z$)()){return/crios\//i.test(n)}function Sr(n=(0,l.z$)()){return/iemobile/i.test(n)}function he(n=(0,l.z$)()){return/android/i.test(n)}function Nr(n=(0,l.z$)()){return/blackberry/i.test(n)}function wr(n=(0,l.z$)()){return/webos/i.test(n)}function J(n=(0,l.z$)()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function br(n=(0,l.z$)()){return J(n)||he(n)||wr(n)||Nr(n)||/windows phone/i.test(n)||Sr(n)}function Cr(n,e=[]){let t;switch(n){case"Browser":t=Ar((0,l.z$)());break;case"Worker":t=`${Ar((0,l.z$)())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${b.SDK_VERSION}/${r}`}function ct(){return(ct=(0,a.Z)(function*(n){return(yield g(n,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""})).apply(this,arguments)}function Or(n,e){return lt.apply(this,arguments)}function lt(){return(lt=(0,a.Z)(function*(n,e){return g(n,"GET","/v2/recaptchaConfig",m(n,e))})).apply(this,arguments)}function Lr(n){return void 0!==n&&void 0!==n.getResponse}function Dr(n){return void 0!==n&&void 0!==n.enterprise}class xr{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some(t=>"EMAIL_PASSWORD_PROVIDER"===t.provider&&"OFF"!==t.enforcementState)}}function dt(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=E("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",function ps(){var n,e;return null!==(e=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==e?e:document}().appendChild(r)})}function Mr(n){return`__${n}${Math.floor(1e6*Math.random())}`}const gs="NO_RECAPTCHA";class Ur{constructor(e){this.type="recaptcha-enterprise",this.auth=v(e)}verify(e="verify",t=!1){var r=this;return(0,a.Z)(function*(){function s(){return s=(0,a.Z)(function*(u){if(!t){if(null==u.tenantId&&null!=u._agentRecaptchaConfig)return u._agentRecaptchaConfig.siteKey;if(null!=u.tenantId&&void 0!==u._tenantRecaptchaConfigs[u.tenantId])return u._tenantRecaptchaConfigs[u.tenantId].siteKey}return new Promise(function(){var c=(0,a.Z)(function*(h,f){Or(u,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(p=>{if(void 0!==p.recaptchaKey){const _=new xr(p);return null==u.tenantId?u._agentRecaptchaConfig=_:u._tenantRecaptchaConfigs[u.tenantId]=_,h(_.siteKey)}f(new Error("recaptcha Enterprise site key undefined"))}).catch(p=>{f(p)})});return function(h,f){return c.apply(this,arguments)}}())}),s.apply(this,arguments)}function o(u,c,h){const f=window.grecaptcha;Dr(f)?f.enterprise.ready(()=>{f.enterprise.execute(u,{action:e}).then(p=>{c(p)}).catch(()=>{c(gs)})}):h(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((u,c)=>{(function i(u){return s.apply(this,arguments)})(r.auth).then(h=>{if(!t&&Dr(window.grecaptcha))o(h,u,c);else{if(typeof window>"u")return void c(new Error("RecaptchaVerifier is only supported in browser"));dt("https://www.google.com/recaptcha/enterprise.js?render="+h).then(()=>{o(h,u,c)}).catch(f=>{c(f)})}}).catch(h=>{c(h)})})})()}}function F(n,e,t){return ht.apply(this,arguments)}function ht(){return(ht=(0,a.Z)(function*(n,e,t,r=!1){const i=new Ur(n);let s;try{s=yield i.verify(t)}catch{s=yield i.verify(t,!0)}const o=Object.assign({},e);return Object.assign(o,r?{captchaResp:s}:{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o})).apply(this,arguments)}class vs{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=s=>new Promise((o,u)=>{try{o(e(s))}catch(c){u(c)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}runMiddleware(e){var t=this;return(0,a.Z)(function*(){if(t.auth.currentUser===e)return;const r=[];try{for(const i of t.queue)yield i(e),i.onAbort&&r.push(i.onAbort)}catch(i){r.reverse();for(const s of r)try{s()}catch{}throw t.auth._errorFactory.create("login-blocked",{originalMessage:null==i?void 0:i.message})}})()}}class Is{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Fr(this),this.idTokenSubscription=new Fr(this),this.beforeStateQueue=new vs(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=_r,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){var r=this;return t&&(this._popupRedirectResolver=R(t)),this._initializationPromise=this.queue((0,a.Z)(function*(){var i,s;if(!r._deleted&&(r.persistenceManager=yield Y.create(r,e),!r._deleted)){if(null!==(i=r._popupRedirectResolver)&&void 0!==i&&i._shouldInitProactively)try{yield r._popupRedirectResolver._initialize(r)}catch{}yield r.initializeCurrentUser(t),r.lastNotifiedUid=(null===(s=r.currentUser)||void 0===s?void 0:s.uid)||null,!r._deleted&&(r._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){var e=this;return(0,a.Z)(function*(){if(e._deleted)return;const t=yield e.assertedPersistence.getCurrentUser();if(e.currentUser||t){if(e.currentUser&&t&&e.currentUser.uid===t.uid)return e._currentUser._assign(t),void(yield e.currentUser.getIdToken());yield e._updateCurrentUser(t,!0)}})()}initializeCurrentUser(e){var t=this;return(0,a.Z)(function*(){var r;const i=yield t.assertedPersistence.getCurrentUser();let s=i,o=!1;if(e&&t.config.authDomain){yield t.getOrInitRedirectPersistenceManager();const u=null===(r=t.redirectUser)||void 0===r?void 0:r._redirectEventId,c=null==s?void 0:s._redirectEventId,h=yield t.tryRedirectSignIn(e);(!u||u===c)&&null!=h&&h.user&&(s=h.user,o=!0)}if(!s)return t.directlySetCurrentUser(null);if(!s._redirectEventId){if(o)try{yield t.beforeStateQueue.runMiddleware(s)}catch(u){s=i,t._popupRedirectResolver._overrideRedirectResult(t,()=>Promise.reject(u))}return s?t.reloadAndSetCurrentUserOrClear(s):t.directlySetCurrentUser(null)}return d(t._popupRedirectResolver,t,"argument-error"),yield t.getOrInitRedirectPersistenceManager(),t.redirectUser&&t.redirectUser._redirectEventId===s._redirectEventId?t.directlySetCurrentUser(s):t.reloadAndSetCurrentUserOrClear(s)})()}tryRedirectSignIn(e){var t=this;return(0,a.Z)(function*(){let r=null;try{r=yield t._popupRedirectResolver._completeRedirectFn(t,e,!0)}catch{yield t._setRedirectUser(null)}return r})()}reloadAndSetCurrentUserOrClear(e){var t=this;return(0,a.Z)(function*(){try{yield le(e)}catch(r){if("auth/network-request-failed"!==(null==r?void 0:r.code))return t.directlySetCurrentUser(null)}return t.directlySetCurrentUser(e)})()}useDeviceLanguage(){this.languageCode=function Ki(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}()}_delete(){var e=this;return(0,a.Z)(function*(){e._deleted=!0})()}updateCurrentUser(e){var t=this;return(0,a.Z)(function*(){const r=e?(0,l.m9)(e):null;return r&&d(r.auth.config.apiKey===t.config.apiKey,t,"invalid-user-token"),t._updateCurrentUser(r&&r._clone(t))})()}_updateCurrentUser(e,t=!1){var r=this;return(0,a.Z)(function*(){if(!r._deleted)return e&&d(r.tenantId===e.tenantId,r,"tenant-id-mismatch"),t||(yield r.beforeStateQueue.runMiddleware(e)),r.queue((0,a.Z)(function*(){yield r.directlySetCurrentUser(e),r.notifyAuthListeners()}))})()}signOut(){var e=this;return(0,a.Z)(function*(){return yield e.beforeStateQueue.runMiddleware(null),(e.redirectPersistenceManager||e._popupRedirectResolver)&&(yield e._setRedirectUser(null)),e._updateCurrentUser(null,!0)})()}setPersistence(e){var t=this;return this.queue((0,a.Z)(function*(){yield t.assertedPersistence.setPersistence(R(e))}))}initializeRecaptchaConfig(){var e=this;return(0,a.Z)(function*(){const t=yield Or(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new xr(t);null==e.tenantId?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,r.emailPasswordEnabled&&new Ur(e).verify()})()}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new l.LL("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}_setRedirectUser(e,t){var r=this;return(0,a.Z)(function*(){const i=yield r.getOrInitRedirectPersistenceManager(t);return null===e?i.removeCurrentUser():i.setCurrentUser(e)})()}getOrInitRedirectPersistenceManager(e){var t=this;return(0,a.Z)(function*(){if(!t.redirectPersistenceManager){const r=e&&R(e)||t._popupRedirectResolver;d(r,t,"argument-error"),t.redirectPersistenceManager=yield Y.create(t,[R(r._redirectPersistence)],"redirectUser"),t.redirectUser=yield t.redirectPersistenceManager.getCurrentUser()}return t.redirectPersistenceManager})()}_redirectUserForId(e){var t=this;return(0,a.Z)(function*(){var r,i;return t._isInitialized&&(yield t.queue((0,a.Z)(function*(){}))),(null===(r=t._currentUser)||void 0===r?void 0:r._redirectEventId)===e?t._currentUser:(null===(i=t.redirectUser)||void 0===i?void 0:i._redirectEventId)===e?t.redirectUser:null})()}_persistUserIfCurrent(e){var t=this;return(0,a.Z)(function*(){if(e===t.currentUser)return t.queue((0,a.Z)(function*(){return t.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);const r=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const s="function"==typeof t?t:t.next.bind(t),o=this._isInitialized?Promise.resolve():this._initializationPromise;return d(o,this,"internal-error"),o.then(()=>s(this.currentUser)),"function"==typeof t?e.addObserver(t,r,i):e.addObserver(t)}directlySetCurrentUser(e){var t=this;return(0,a.Z)(function*(){t.currentUser&&t.currentUser!==e&&t._currentUser._stopProactiveRefresh(),e&&t.isProactiveRefreshEnabled&&e._startProactiveRefresh(),t.currentUser=e,e?yield t.assertedPersistence.setCurrentUser(e):yield t.assertedPersistence.removeCurrentUser()})()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return d(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Cr(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){var e=this;return(0,a.Z)(function*(){var t;const r={"X-Client-Version":e.clientVersion};e.app.options.appId&&(r["X-Firebase-gmpid"]=e.app.options.appId);const i=yield null===(t=e.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader();i&&(r["X-Firebase-Client"]=i);const s=yield e._getAppCheckToken();return s&&(r["X-Firebase-AppCheck"]=s),r})()}_getAppCheckToken(){var e=this;return(0,a.Z)(function*(){var t;const r=yield null===(t=e.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getToken();return null!=r&&r.error&&function $i(n,...e){Re.logLevel<=qe.in.WARN&&Re.warn(`Auth (${b.SDK_VERSION}): ${n}`,...e)}(`Error while retrieving App Check token: ${r.error}`),null==r?void 0:r.token})()}}function v(n){return(0,l.m9)(n)}class Fr{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,l.ne)(t=>this.observer=t)}get next(){return d(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function Zr(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function Wr(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}class X{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return N("not implemented")}_getIdTokenResponse(e){return N("not implemented")}_linkToIdToken(e,t){return N("not implemented")}_getReauthenticationResolver(e){return N("not implemented")}}function Hr(n,e){return ft.apply(this,arguments)}function ft(){return(ft=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:resetPassword",m(n,e))})).apply(this,arguments)}function zr(n,e){return pt.apply(this,arguments)}function pt(){return(pt=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:update",e)})).apply(this,arguments)}function mt(){return(mt=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:update",m(n,e))})).apply(this,arguments)}function _t(n,e){return gt.apply(this,arguments)}function gt(){return(gt=(0,a.Z)(function*(n,e){return C(n,"POST","/v1/accounts:signInWithPassword",m(n,e))})).apply(this,arguments)}function Pe(n,e){return vt.apply(this,arguments)}function vt(){return(vt=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:sendOobCode",m(n,e))})).apply(this,arguments)}function It(){return(It=(0,a.Z)(function*(n,e){return Pe(n,e)})).apply(this,arguments)}function yt(n,e){return Et.apply(this,arguments)}function Et(){return(Et=(0,a.Z)(function*(n,e){return Pe(n,e)})).apply(this,arguments)}function Tt(n,e){return Rt.apply(this,arguments)}function Rt(){return(Rt=(0,a.Z)(function*(n,e){return Pe(n,e)})).apply(this,arguments)}function At(){return(At=(0,a.Z)(function*(n,e){return Pe(n,e)})).apply(this,arguments)}function kt(){return(kt=(0,a.Z)(function*(n,e){return C(n,"POST","/v1/accounts:signInWithEmailLink",m(n,e))})).apply(this,arguments)}function Pt(){return(Pt=(0,a.Z)(function*(n,e){return C(n,"POST","/v1/accounts:signInWithEmailLink",m(n,e))})).apply(this,arguments)}class fe extends X{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new fe(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new fe(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if(null!=t&&t.email&&null!=t&&t.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}_getIdTokenResponse(e){var t=this;return(0,a.Z)(function*(){var r;switch(t.signInMethod){case"password":const i={returnSecureToken:!0,email:t._email,password:t._password,clientType:"CLIENT_TYPE_WEB"};if(null!==(r=e._getRecaptchaConfig())&&void 0!==r&&r.emailPasswordEnabled){const s=yield F(e,i,"signInWithPassword");return _t(e,s)}return _t(e,i).catch(function(){var s=(0,a.Z)(function*(o){if("auth/missing-recaptcha-token"===o.code){console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const u=yield F(e,i,"signInWithPassword");return _t(e,u)}return Promise.reject(o)});return function(o){return s.apply(this,arguments)}}());case"emailLink":return function Ss(n,e){return kt.apply(this,arguments)}(e,{email:t._email,oobCode:t._password});default:y(e,"internal-error")}})()}_linkToIdToken(e,t){var r=this;return(0,a.Z)(function*(){switch(r.signInMethod){case"password":return zr(e,{idToken:t,returnSecureToken:!0,email:r._email,password:r._password});case"emailLink":return function Ns(n,e){return Pt.apply(this,arguments)}(e,{idToken:t,email:r._email,oobCode:r._password});default:y(e,"internal-error")}})()}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}function L(n,e){return St.apply(this,arguments)}function St(){return(St=(0,a.Z)(function*(n,e){return C(n,"POST","/v1/accounts:signInWithIdp",m(n,e))})).apply(this,arguments)}class w extends X{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new w(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):y("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,s=(0,Ge._T)(t,["providerId","signInMethod"]);if(!r||!i)return null;const o=new w(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){return L(e,this.buildRequest())}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,L(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,L(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,l.xO)(t)}return e}}function Nt(){return(Nt=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:sendVerificationCode",m(n,e))})).apply(this,arguments)}function wt(){return(wt=(0,a.Z)(function*(n,e){return C(n,"POST","/v1/accounts:signInWithPhoneNumber",m(n,e))})).apply(this,arguments)}function bt(){return(bt=(0,a.Z)(function*(n,e){const t=yield C(n,"POST","/v1/accounts:signInWithPhoneNumber",m(n,e));if(t.temporaryProof)throw ue(n,"account-exists-with-different-credential",t);return t})).apply(this,arguments)}const Ls={USER_NOT_FOUND:"user-not-found"};function Ct(){return(Ct=(0,a.Z)(function*(n,e){return C(n,"POST","/v1/accounts:signInWithPhoneNumber",m(n,Object.assign(Object.assign({},e),{operation:"REAUTH"})),Ls)})).apply(this,arguments)}class z extends X{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new z({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new z({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return function Cs(n,e){return wt.apply(this,arguments)}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return function Os(n,e){return bt.apply(this,arguments)}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return function Ds(n,e){return Ct.apply(this,arguments)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:r,verificationCode:i}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:r,code:i}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:s}=e;return r||t||i||s?new z({verificationId:t,verificationCode:r,phoneNumber:i,temporaryProof:s}):null}}class pe{constructor(e){var t,r,i,s,o,u;const c=(0,l.zd)((0,l.pd)(e)),h=null!==(t=c.apiKey)&&void 0!==t?t:null,f=null!==(r=c.oobCode)&&void 0!==r?r:null,p=function xs(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(i=c.mode)&&void 0!==i?i:null);d(h&&f&&p,"argument-error"),this.apiKey=h,this.operation=p,this.code=f,this.continueUrl=null!==(s=c.continueUrl)&&void 0!==s?s:null,this.languageCode=null!==(o=c.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(u=c.tenantId)&&void 0!==u?u:null}static parseLink(e){const t=function Ms(n){const e=(0,l.zd)((0,l.pd)(n)).link,t=e?(0,l.zd)((0,l.pd)(e)).deep_link_id:null,r=(0,l.zd)((0,l.pd)(n)).deep_link_id;return(r?(0,l.zd)((0,l.pd)(r)).link:null)||r||t||e||n}(e);try{return new pe(t)}catch{return null}}}let Ot=(()=>{class n{constructor(){this.providerId=n.PROVIDER_ID}static credential(t,r){return fe._fromEmailAndPassword(t,r)}static credentialWithLink(t,r){const i=pe.parseLink(r);return d(i,"argument-error"),fe._fromEmailAndCode(t,i.code,i.tenantId)}}return n.PROVIDER_ID="password",n.EMAIL_PASSWORD_SIGN_IN_METHOD="password",n.EMAIL_LINK_SIGN_IN_METHOD="emailLink",n})();class D{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 Q extends D{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class ee extends Q{static credentialFromJSON(e){const t="string"==typeof e?JSON.parse(e):e;return d("providerId"in t&&"signInMethod"in t,"argument-error"),w._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return d(e.idToken||e.accessToken,"argument-error"),w._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return ee.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return ee.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r,oauthTokenSecret:i,pendingToken:s,nonce:o,providerId:u}=e;if(!r&&!i&&!t&&!s||!u)return null;try{return new ee(u)._credential({idToken:t,accessToken:r,nonce:o,pendingToken:s})}catch{return null}}}let Gr=(()=>{class n extends Q{constructor(){super("facebook.com")}static credential(t){return w._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch{return null}}}return n.FACEBOOK_SIGN_IN_METHOD="facebook.com",n.PROVIDER_ID="facebook.com",n})(),qr=(()=>{class n extends Q{constructor(){super("google.com"),this.addScope("profile")}static credential(t,r){return w._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:r})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:r,oauthAccessToken:i}=t;if(!r&&!i)return null;try{return n.credential(r,i)}catch{return null}}}return n.GOOGLE_SIGN_IN_METHOD="google.com",n.PROVIDER_ID="google.com",n})(),$r=(()=>{class n extends Q{constructor(){super("github.com")}static credential(t){return w._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch{return null}}}return n.GITHUB_SIGN_IN_METHOD="github.com",n.PROVIDER_ID="github.com",n})();class te extends X{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return L(e,this.buildRequest())}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,L(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,L(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:r,signInMethod:i,pendingToken:s}=t;return r&&i&&s&&r===i?new te(r,s):null}static _create(e,t){return new te(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class Se extends D{constructor(e){d(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return Se.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return Se.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){const t=te.fromJSON(e);return d(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{pendingToken:t,providerId:r}=e;if(!t||!r)return null;try{return te._create(r,t)}catch{return null}}}let Br=(()=>{class n extends Q{constructor(){super("twitter.com")}static credential(t,r){return w._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:r})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:r,oauthTokenSecret:i}=t;if(!r||!i)return null;try{return n.credential(r,i)}catch{return null}}}return n.TWITTER_SIGN_IN_METHOD="twitter.com",n.PROVIDER_ID="twitter.com",n})();function Ne(n,e){return Lt.apply(this,arguments)}function Lt(){return(Lt=(0,a.Z)(function*(n,e){return C(n,"POST","/v1/accounts:signUp",m(n,e))})).apply(this,arguments)}class k{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static _fromIdTokenResponse(e,t,r,i=!1){return(0,a.Z)(function*(){const s=yield W._fromIdTokenResponse(e,r,i),o=Kr(r);return new k({user:s,providerId:o,_tokenResponse:r,operationType:t})})()}static _forOperation(e,t,r){return(0,a.Z)(function*(){yield e._updateTokensIfNecessary(r,!0);const i=Kr(r);return new k({user:e,providerId:i,_tokenResponse:r,operationType:t})})()}}function Kr(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}function Dt(){return(Dt=(0,a.Z)(function*(n){var e;const t=v(n);if(yield t._initializationPromise,null!==(e=t.currentUser)&&void 0!==e&&e.isAnonymous)return new k({user:t.currentUser,providerId:null,operationType:"signIn"});const r=yield Ne(t,{returnSecureToken:!0}),i=yield k._fromIdTokenResponse(t,"signIn",r,!0);return yield t._updateCurrentUser(i.user),i})).apply(this,arguments)}class we extends l.ZR{constructor(e,t,r,i){var s;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,we.prototype),this.customData={appName:e.name,tenantId:null!==(s=e.tenantId)&&void 0!==s?s:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new we(e,t,r,i)}}function jr(n,e,t,r){return("reauthenticate"===e?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw"auth/multi-factor-auth-required"===s.code?we._fromErrorAndOperation(n,s,e,r):s})}function Yr(n){return new Set(n.map(({providerId:e})=>e).filter(e=>!!e))}function xt(){return xt=(0,a.Z)(function*(n,e){const t=(0,l.m9)(n);yield be(!0,t,e);const{providerUserInfo:r}=yield function Qi(n,e){return et.apply(this,arguments)}(t.auth,{idToken:yield t.getIdToken(),deleteProvider:[e]}),i=Yr(r||[]);return t.providerData=t.providerData.filter(s=>i.has(s.providerId)),i.has("phone")||(t.phoneNumber=null),yield t.auth._persistUserIfCurrent(t),t}),xt.apply(this,arguments)}function Mt(n,e){return Ut.apply(this,arguments)}function Ut(){return(Ut=(0,a.Z)(function*(n,e,t=!1){const r=yield O(n,e._linkToIdToken(n.auth,yield n.getIdToken()),t);return k._forOperation(n,"link",r)})).apply(this,arguments)}function be(n,e,t){return Ft.apply(this,arguments)}function Ft(){return(Ft=(0,a.Z)(function*(n,e,t){yield le(e);const i=!1===n?"provider-already-linked":"no-such-provider";d(Yr(e.providerData).has(t)===n,e.auth,i)})).apply(this,arguments)}function Jr(n,e){return Vt.apply(this,arguments)}function Vt(){return(Vt=(0,a.Z)(function*(n,e,t=!1){const{auth:r}=n,i="reauthenticate";try{const s=yield O(n,jr(r,i,e,n),t);d(s.idToken,r,"internal-error");const o=ke(s.idToken);d(o,r,"internal-error");const{sub:u}=o;return d(n.uid===u,r,"user-mismatch"),k._forOperation(n,i,s)}catch(s){throw"auth/user-not-found"===(null==s?void 0:s.code)&&y(r,"user-mismatch"),s}})).apply(this,arguments)}function Xr(n,e){return Zt.apply(this,arguments)}function Zt(){return(Zt=(0,a.Z)(function*(n,e,t=!1){const r="signIn",i=yield jr(n,r,e),s=yield k._fromIdTokenResponse(n,r,i);return t||(yield n._updateCurrentUser(s.user)),s})).apply(this,arguments)}function Ce(n,e){return Wt.apply(this,arguments)}function Wt(){return(Wt=(0,a.Z)(function*(n,e){return Xr(v(n),e)})).apply(this,arguments)}function Qr(n,e){return Ht.apply(this,arguments)}function Ht(){return(Ht=(0,a.Z)(function*(n,e){const t=(0,l.m9)(n);return yield be(!1,t,e.providerId),Mt(t,e)})).apply(this,arguments)}function ei(n,e){return zt.apply(this,arguments)}function zt(){return(zt=(0,a.Z)(function*(n,e){return Jr((0,l.m9)(n),e)})).apply(this,arguments)}function Gt(){return(Gt=(0,a.Z)(function*(n,e){return C(n,"POST","/v1/accounts:signInWithCustomToken",m(n,e))})).apply(this,arguments)}function qt(){return qt=(0,a.Z)(function*(n,e){const t=v(n),r=yield function Ws(n,e){return Gt.apply(this,arguments)}(t,{token:e,returnSecureToken:!0}),i=yield k._fromIdTokenResponse(t,"signIn",r);return yield t._updateCurrentUser(i.user),i}),qt.apply(this,arguments)}class me{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?$t._fromServerResponse(e,t):"totpInfo"in t?Bt._fromServerResponse(e,t):y(e,"internal-error")}}class $t extends me{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new $t(t)}}class Bt extends me{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new Bt(t)}}function ne(n,e,t){var r;d((null===(r=t.url)||void 0===r?void 0:r.length)>0,n,"invalid-continue-uri"),d(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(d(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(d(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}function Kt(){return Kt=(0,a.Z)(function*(n,e,t){var r;const i=v(n),s={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};if(null!==(r=i._getRecaptchaConfig())&&void 0!==r&&r.emailPasswordEnabled){const o=yield F(i,s,"getOobCode",!0);t&&ne(i,o,t),yield yt(i,o)}else t&&ne(i,s,t),yield yt(i,s).catch(function(){var o=(0,a.Z)(function*(u){if("auth/missing-recaptcha-token"!==u.code)return Promise.reject(u);{console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");const c=yield F(i,s,"getOobCode",!0);t&&ne(i,c,t),yield yt(i,c)}});return function(u){return o.apply(this,arguments)}}())}),Kt.apply(this,arguments)}function jt(){return(jt=(0,a.Z)(function*(n,e,t){yield Hr((0,l.m9)(n),{oobCode:e,newPassword:t})})).apply(this,arguments)}function Yt(){return Yt=(0,a.Z)(function*(n,e){yield function As(n,e){return mt.apply(this,arguments)}((0,l.m9)(n),{oobCode:e})}),Yt.apply(this,arguments)}function ti(n,e){return Jt.apply(this,arguments)}function Jt(){return(Jt=(0,a.Z)(function*(n,e){const t=(0,l.m9)(n),r=yield Hr(t,{oobCode:e}),i=r.requestType;switch(d(i,t,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":d(r.newEmail,t,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":d(r.mfaInfo,t,"internal-error");default:d(r.email,t,"internal-error")}let s=null;return r.mfaInfo&&(s=me._fromServerResponse(v(t),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:s},operation:i}})).apply(this,arguments)}function Xt(){return(Xt=(0,a.Z)(function*(n,e){const{data:t}=yield ti((0,l.m9)(n),e);return t.email})).apply(this,arguments)}function Qt(){return Qt=(0,a.Z)(function*(n,e,t){var r;const i=v(n),s={returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"};let o;if(null!==(r=i._getRecaptchaConfig())&&void 0!==r&&r.emailPasswordEnabled){const h=yield F(i,s,"signUpPassword");o=Ne(i,h)}else o=Ne(i,s).catch(function(){var h=(0,a.Z)(function*(f){if("auth/missing-recaptcha-token"===f.code){console.log("Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow.");const p=yield F(i,s,"signUpPassword");return Ne(i,p)}return Promise.reject(f)});return function(f){return h.apply(this,arguments)}}());const u=yield o.catch(h=>Promise.reject(h)),c=yield k._fromIdTokenResponse(i,"signIn",u);return yield i._updateCurrentUser(c.user),c}),Qt.apply(this,arguments)}function en(){return en=(0,a.Z)(function*(n,e,t){var r;const i=v(n),s={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function o(u,c){d(c.handleCodeInApp,i,"argument-error"),c&&ne(i,u,c)}if(null!==(r=i._getRecaptchaConfig())&&void 0!==r&&r.emailPasswordEnabled){const u=yield F(i,s,"getOobCode",!0);o(u,t),yield Tt(i,u)}else o(s,t),yield Tt(i,s).catch(function(){var u=(0,a.Z)(function*(c){if("auth/missing-recaptcha-token"!==c.code)return Promise.reject(c);{console.log("Email link sign-in is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const h=yield F(i,s,"getOobCode",!0);o(h,t),yield Tt(i,h)}});return function(c){return u.apply(this,arguments)}}())}),en.apply(this,arguments)}function tn(){return(tn=(0,a.Z)(function*(n,e,t){const r=(0,l.m9)(n),i=Ot.credentialWithLink(e,t||oe());return d(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Ce(r,i)})).apply(this,arguments)}function nn(){return(nn=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:createAuthUri",m(n,e))})).apply(this,arguments)}function rn(){return rn=(0,a.Z)(function*(n,e){const r={identifier:e,continueUri:Ke()?oe():"http://localhost"},{signinMethods:i}=yield function Xs(n,e){return nn.apply(this,arguments)}((0,l.m9)(n),r);return i||[]}),rn.apply(this,arguments)}function sn(){return sn=(0,a.Z)(function*(n,e){const t=(0,l.m9)(n),i={requestType:"VERIFY_EMAIL",idToken:yield n.getIdToken()};e&&ne(t.auth,i,e);const{email:s}=yield function ks(n,e){return It.apply(this,arguments)}(t.auth,i);s!==n.email&&(yield n.reload())}),sn.apply(this,arguments)}function on(){return on=(0,a.Z)(function*(n,e,t){const r=(0,l.m9)(n),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:yield n.getIdToken(),newEmail:e};t&&ne(r.auth,s,t);const{email:o}=yield function Ps(n,e){return At.apply(this,arguments)}(r.auth,s);o!==n.email&&(yield n.reload())}),on.apply(this,arguments)}function an(){return(an=(0,a.Z)(function*(n,e){return g(n,"POST","/v1/accounts:update",e)})).apply(this,arguments)}function un(){return un=(0,a.Z)(function*(n,{displayName:e,photoURL:t}){if(void 0===e&&void 0===t)return;const r=(0,l.m9)(n),s={idToken:yield r.getIdToken(),displayName:e,photoUrl:t,returnSecureToken:!0},o=yield O(r,function no(n,e){return an.apply(this,arguments)}(r.auth,s));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const u=r.providerData.find(({providerId:c})=>"password"===c);u&&(u.displayName=r.displayName,u.photoURL=r.photoURL),yield r._updateTokensIfNecessary(o)}),un.apply(this,arguments)}function ni(n,e,t){return cn.apply(this,arguments)}function cn(){return(cn=(0,a.Z)(function*(n,e,t){const{auth:r}=n,s={idToken:yield n.getIdToken(),returnSecureToken:!0};e&&(s.email=e),t&&(s.password=t);const o=yield O(n,zr(r,s));yield n._updateTokensIfNecessary(o,!0)})).apply(this,arguments)}class re{constructor(e,t,r={}){this.isNewUser=e,this.providerId=t,this.profile=r}}class ri extends re{constructor(e,t,r,i){super(e,t,r),this.username=i}}class ao extends re{constructor(e,t){super(e,"facebook.com",t)}}class uo extends ri{constructor(e,t){super(e,"github.com",t,"string"==typeof(null==t?void 0:t.login)?null==t?void 0:t.login:null)}}class co extends re{constructor(e,t){super(e,"google.com",t)}}class lo extends ri{constructor(e,t,r){super(e,"twitter.com",t,r)}}function ho(n){const{user:e,_tokenResponse:t}=n;return e.isAnonymous&&!t?{providerId:null,isNewUser:!1,profile:null}:function oo(n){var e,t;if(!n)return null;const{providerId:r}=n,i=n.rawUserInfo?JSON.parse(n.rawUserInfo):{},s=n.isNewUser||"identitytoolkit#SignupNewUserResponse"===n.kind;if(!r&&null!=n&&n.idToken){const o=null===(t=null===(e=ke(n.idToken))||void 0===e?void 0:e.firebase)||void 0===t?void 0:t.sign_in_provider;if(o)return new re(s,"anonymous"!==o&&"custom"!==o?o:null)}if(!r)return null;switch(r){case"facebook.com":return new ao(s,i);case"github.com":return new uo(s,i);case"google.com":return new co(s,i);case"twitter.com":return new lo(s,i,n.screenName||null);case"custom":case"anonymous":return new re(s,null);default:return new re(s,r,i)}}(t)}class G{constructor(e,t,r){this.type=e,this.credential=t,this.auth=r}static _fromIdtoken(e,t){return new G("enroll",e,t)}static _fromMfaPendingCredential(e){return new G("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,r;if(null!=e&&e.multiFactorSession){if(null!==(t=e.multiFactorSession)&&void 0!==t&&t.pendingCredential)return G._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(null!==(r=e.multiFactorSession)&&void 0!==r&&r.idToken)return G._fromIdtoken(e.multiFactorSession.idToken)}return null}}class dn{constructor(e,t,r){this.session=e,this.hints=t,this.signInResolver=r}static _fromError(e,t){const r=v(e),i=t.customData._serverResponse,s=(i.mfaInfo||[]).map(u=>me._fromServerResponse(r,u));d(i.mfaPendingCredential,r,"internal-error");const o=G._fromMfaPendingCredential(i.mfaPendingCredential);return new dn(o,s,function(){var u=(0,a.Z)(function*(c){const h=yield c._process(r,o);delete i.mfaInfo,delete i.mfaPendingCredential;const f=Object.assign(Object.assign({},i),{idToken:h.idToken,refreshToken:h.refreshToken});switch(t.operationType){case"signIn":const p=yield k._fromIdTokenResponse(r,t.operationType,f);return yield r._updateCurrentUser(p.user),p;case"reauthenticate":return d(t.user,r,"internal-error"),k._forOperation(t.user,t.operationType,f);default:y(r,"internal-error")}});return function(c){return u.apply(this,arguments)}}())}resolveSignIn(e){var t=this;return(0,a.Z)(function*(){return t.signInResolver(e)})()}}class hn{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(r=>me._fromServerResponse(e.auth,r)))})}static _fromUser(e){return new hn(e)}getSession(){var e=this;return(0,a.Z)(function*(){return G._fromIdtoken(yield e.user.getIdToken(),e.user.auth)})()}enroll(e,t){var r=this;return(0,a.Z)(function*(){const i=e,s=yield r.getSession(),o=yield O(r.user,i._process(r.user.auth,s,t));return yield r.user._updateTokensIfNecessary(o),r.user.reload()})()}unenroll(e){var t=this;return(0,a.Z)(function*(){const r="string"==typeof e?e:e.uid,i=yield t.user.getIdToken();try{const s=yield O(t.user,function Io(n,e){return g(n,"POST","/v2/accounts/mfaEnrollment:withdraw",m(n,e))}(t.user.auth,{idToken:i,mfaEnrollmentId:r}));t.enrolledFactors=t.enrolledFactors.filter(({uid:o})=>o!==r),yield t.user._updateTokensIfNecessary(s),yield t.user.reload()}catch(s){throw s}})()}}const fn=new WeakMap,Oe="__sak";class ii{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Oe,"1"),this.storage.removeItem(Oe),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}const Le=(()=>{class n extends ii{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function Eo(){const n=(0,l.z$)();return ut(n)||J(n)}()&&function hs(){try{return!(!window||window===window.top)}catch{return!1}}(),this.fallbackToPolling=br(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const r of Object.keys(this.listeners)){const i=this.storage.getItem(r),s=this.localCache[r];i!==s&&t(r,s,i)}}onStorageEvent(t,r=!1){if(!t.key)return void this.forAllChangedKeys((u,c,h)=>{this.notifyListeners(u,h)});const i=t.key;if(r?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const u=this.storage.getItem(i);if(t.newValue!==u)null!==t.newValue?this.storage.setItem(i,t.newValue):this.storage.removeItem(i);else if(this.localCache[i]===t.newValue&&!r)return}const s=()=>{const u=this.storage.getItem(i);!r&&this.localCache[i]===u||this.notifyListeners(i,u)},o=this.storage.getItem(i);!function ds(){return(0,l.w1)()&&10===document.documentMode}()||o===t.newValue||t.newValue===t.oldValue?s():setTimeout(s,10)}notifyListeners(t,r){this.localCache[t]=r;const i=this.listeners[t];if(i)for(const s of Array.from(i))s(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,r,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:r,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(t,r){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}_set(t,r){var i=()=>super._set,s=this;return(0,a.Z)(function*(){yield i().call(s,t,r),s.localCache[t]=JSON.stringify(r)})()}_get(t){var r=()=>super._get,i=this;return(0,a.Z)(function*(){const s=yield r().call(i,t);return i.localCache[t]=JSON.stringify(s),s})()}_remove(t){var r=()=>super._remove,i=this;return(0,a.Z)(function*(){yield r().call(i,t),delete i.localCache[t]})()}}return n.type="LOCAL",n})(),V=(()=>{class n extends ii{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}return n.type="SESSION",n})();let ko=(()=>{class n{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const r=this.receivers.find(s=>s.isListeningto(t));if(r)return r;const i=new n(t);return this.receivers.push(i),i}isListeningto(t){return this.eventTarget===t}handleEvent(t){var r=this;return(0,a.Z)(function*(){const i=t,{eventId:s,eventType:o,data:u}=i.data,c=r.handlersMap[o];if(null==c||!c.size)return;i.ports[0].postMessage({status:"ack",eventId:s,eventType:o});const h=Array.from(c).map(function(){var p=(0,a.Z)(function*(_){return _(i.origin,u)});return function(_){return p.apply(this,arguments)}}()),f=yield function Ao(n){return Promise.all(n.map(function(){var e=(0,a.Z)(function*(t){try{return{fulfilled:!0,value:yield t}}catch(r){return{fulfilled:!1,reason:r}}});return function(t){return e.apply(this,arguments)}}()))}(h);i.ports[0].postMessage({status:"done",eventId:s,eventType:o,response:f})})()}_subscribe(t,r){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(r)}_unsubscribe(t,r){this.handlersMap[t]&&r&&this.handlersMap[t].delete(r),(!r||0===this.handlersMap[t].size)&&delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}return n.receivers=[],n})();function _e(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(10*Math.random());return n+t}class Po{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)}_send(e,t,r=50){var i=this;return(0,a.Z)(function*(){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let o,u;return new Promise((c,h)=>{const f=_e("",20);s.port1.start();const p=setTimeout(()=>{h(new Error("unsupported_event"))},r);u={messageChannel:s,onMessage(_){const S=_;if(S.data.eventId===f)switch(S.data.status){case"ack":clearTimeout(p),o=setTimeout(()=>{h(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),c(S.data.response);break;default:clearTimeout(p),clearTimeout(o),h(new Error("invalid_response"))}}},i.handlers.add(u),s.port1.addEventListener("message",u.onMessage),i.target.postMessage({eventType:e,eventId:f,data:t},[s.port2])}).finally(()=>{u&&i.removeMessageHandler(u)})})()}}function I(){return window}function pn(){return typeof I().WorkerGlobalScope<"u"&&"function"==typeof I().importScripts}function mn(){return(mn=(0,a.Z)(function*(){if(null==navigator||!navigator.serviceWorker)return null;try{return(yield navigator.serviceWorker.ready).active}catch{return null}})).apply(this,arguments)}const si="firebaseLocalStorageDb",Co=1,De="firebaseLocalStorage",oi="fbase_key";class ge{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 xe(n,e){return n.transaction([De],e?"readwrite":"readonly").objectStore(De)}function _n(){const n=indexedDB.open(si,Co);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(De,{keyPath:oi})}catch(i){t(i)}}),n.addEventListener("success",(0,a.Z)(function*(){const r=n.result;r.objectStoreNames.contains(De)?e(r):(r.close(),yield function Oo(){const n=indexedDB.deleteDatabase(si);return new ge(n).toPromise()}(),e(yield _n()))}))})}function ai(n,e,t){return gn.apply(this,arguments)}function gn(){return(gn=(0,a.Z)(function*(n,e,t){const r=xe(n,!0).put({[oi]:e,value:t});return new ge(r).toPromise()})).apply(this,arguments)}function vn(){return(vn=(0,a.Z)(function*(n,e){const t=xe(n,!1).get(e),r=yield new ge(t).toPromise();return void 0===r?null:r.value})).apply(this,arguments)}function ui(n,e){const t=xe(n,!0).delete(e);return new ge(t).toPromise()}const ie=(()=>{class n{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(()=>{},()=>{})}_openDb(){var t=this;return(0,a.Z)(function*(){return t.db||(t.db=yield _n()),t.db})()}_withRetries(t){var r=this;return(0,a.Z)(function*(){let i=0;for(;;)try{const s=yield r._openDb();return yield t(s)}catch(s){if(i++>3)throw s;r.db&&(r.db.close(),r.db=void 0)}})()}initializeServiceWorkerMessaging(){var t=this;return(0,a.Z)(function*(){return pn()?t.initializeReceiver():t.initializeSender()})()}initializeReceiver(){var t=this;return(0,a.Z)(function*(){t.receiver=ko._getInstance(function bo(){return pn()?self:null}()),t.receiver._subscribe("keyChanged",function(){var r=(0,a.Z)(function*(i,s){return{keyProcessed:(yield t._poll()).includes(s.key)}});return function(i,s){return r.apply(this,arguments)}}()),t.receiver._subscribe("ping",function(){var r=(0,a.Z)(function*(i,s){return["keyChanged"]});return function(i,s){return r.apply(this,arguments)}}())})()}initializeSender(){var t=this;return(0,a.Z)(function*(){var r,i;if(t.activeServiceWorker=yield function No(){return mn.apply(this,arguments)}(),!t.activeServiceWorker)return;t.sender=new Po(t.activeServiceWorker);const s=yield t.sender._send("ping",{},800);s&&null!==(r=s[0])&&void 0!==r&&r.fulfilled&&null!==(i=s[0])&&void 0!==i&&i.value.includes("keyChanged")&&(t.serviceWorkerReceiverAvailable=!0)})()}notifyServiceWorker(t){var r=this;return(0,a.Z)(function*(){if(r.sender&&r.activeServiceWorker&&function wo(){var n;return(null===(n=null==navigator?void 0:navigator.serviceWorker)||void 0===n?void 0:n.controller)||null}()===r.activeServiceWorker)try{yield r.sender._send("keyChanged",{key:t},r.serviceWorkerReceiverAvailable?800:50)}catch{}})()}_isAvailable(){return(0,a.Z)(function*(){try{if(!indexedDB)return!1;const t=yield _n();return yield ai(t,Oe,"1"),yield ui(t,Oe),!0}catch{}return!1})()}_withPendingWrite(t){var r=this;return(0,a.Z)(function*(){r.pendingWrites++;try{yield t()}finally{r.pendingWrites--}})()}_set(t,r){var i=this;return(0,a.Z)(function*(){return i._withPendingWrite((0,a.Z)(function*(){return yield i._withRetries(s=>ai(s,t,r)),i.localCache[t]=r,i.notifyServiceWorker(t)}))})()}_get(t){var r=this;return(0,a.Z)(function*(){const i=yield r._withRetries(s=>function Lo(n,e){return vn.apply(this,arguments)}(s,t));return r.localCache[t]=i,i})()}_remove(t){var r=this;return(0,a.Z)(function*(){return r._withPendingWrite((0,a.Z)(function*(){return yield r._withRetries(i=>ui(i,t)),delete r.localCache[t],r.notifyServiceWorker(t)}))})()}_poll(){var t=this;return(0,a.Z)(function*(){const r=yield t._withRetries(o=>{const u=xe(o,!1).getAll();return new ge(u).toPromise()});if(!r)return[];if(0!==t.pendingWrites)return[];const i=[],s=new Set;for(const{fbase_key:o,value:u}of r)s.add(o),JSON.stringify(t.localCache[o])!==JSON.stringify(u)&&(t.notifyListeners(o,u),i.push(o));for(const o of Object.keys(t.localCache))t.localCache[o]&&!s.has(o)&&(t.notifyListeners(o,null),i.push(o));return i})()}notifyListeners(t,r){this.localCache[t]=r;const i=this.listeners[t];if(i)for(const s of Array.from(i))s(r)}startPolling(){var t=this;this.stopPolling(),this.pollTimer=setInterval((0,a.Z)(function*(){return t._poll()}),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,r){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&this.stopPolling()}}return n.type="LOCAL",n})(),Me=1e12;class Wo{constructor(e){this.auth=e,this.counter=Me,this._widgets=new Map}render(e,t){const r=this.counter;return this._widgets.set(r,new Ho(e,this.auth.name,t||{})),this.counter++,r}reset(e){var t;const r=e||Me;null===(t=this._widgets.get(r))||void 0===t||t.delete(),this._widgets.delete(r)}getResponse(e){var t;return(null===(t=this._widgets.get(e||Me))||void 0===t?void 0:t.getResponse())||""}execute(e){var t=this;return(0,a.Z)(function*(){var r;return null===(r=t._widgets.get(e||Me))||void 0===r||r.execute(),""})()}}class Ho{constructor(e,t,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const i="string"==typeof e?document.getElementById(e):e;d(i,"argument-error",{appName:t}),this.container=i,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 zo(n){const e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<n;r++)e.push(t.charAt(Math.floor(Math.random()*t.length)));return e.join("")}(50);const{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch{}this.isVisible&&this.execute()},6e4)},500))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}const In=Mr("rcb"),Go=new ae(3e4,6e4);class $o{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!(null===(e=I().grecaptcha)||void 0===e||!e.render)}load(e,t=""){return d(function Bo(n){return n.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(n)}(t),e,"argument-error"),this.shouldResolveImmediately(t)&&Lr(I().grecaptcha)?Promise.resolve(I().grecaptcha):new Promise((r,i)=>{const s=I().setTimeout(()=>{i(E(e,"network-request-failed"))},Go.get());I()[In]=()=>{I().clearTimeout(s),delete I()[In];const u=I().grecaptcha;if(!u||!Lr(u))return void i(E(e,"internal-error"));const c=u.render;u.render=(h,f)=>{const p=c(h,f);return this.counter++,p},this.hostLanguage=t,r(u)},dt(`https://www.google.com/recaptcha/api.js??${(0,l.xO)({onload:In,render:"explicit",hl:t})}`).catch(()=>{clearTimeout(s),i(E(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!(null===(t=I().grecaptcha)||void 0===t||!t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class Ko{load(e){return(0,a.Z)(function*(){return new Wo(e)})()}clearedOneInstance(){}}const ci="recaptcha",jo={theme:"light",type:"image"};class Yo{constructor(e,t=Object.assign({},jo),r){this.parameters=t,this.type=ci,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=v(r),this.isInvisible="invisible"===this.parameters.size,d(typeof document<"u",this.auth,"operation-not-supported-in-this-environment");const i="string"==typeof e?document.getElementById(e):e;d(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Ko:new $o,this.validateStartingState()}verify(){var e=this;return(0,a.Z)(function*(){e.assertNotDestroyed();const t=yield e.render(),r=e.getAssertedRecaptcha();return r.getResponse(t)||new Promise(s=>{const o=u=>{u&&(e.tokenChangeListeners.delete(o),s(u))};e.tokenChangeListeners.add(o),e.isInvisible&&r.execute(t)})})()}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(){d(!this.parameters.sitekey,this.auth,"argument-error"),d(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),d(typeof document<"u",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(r=>r(t)),"function"==typeof e)e(t);else if("string"==typeof e){const r=I()[e];"function"==typeof r&&r(t)}}}assertNotDestroyed(){d(!this.destroyed,this.auth,"internal-error")}makeRenderPromise(){var e=this;return(0,a.Z)(function*(){if(yield e.init(),!e.widgetId){let t=e.container;if(!e.isInvisible){const r=document.createElement("div");t.appendChild(r),t=r}e.widgetId=e.getAssertedRecaptcha().render(t,e.parameters)}return e.widgetId})()}init(){var e=this;return(0,a.Z)(function*(){d(Ke()&&!pn(),e.auth,"internal-error"),yield function Jo(){let n=null;return new Promise(e=>{"complete"!==document.readyState?(n=()=>e(),window.addEventListener("load",n)):e()}).catch(e=>{throw n&&window.removeEventListener("load",n),e})}(),e.recaptcha=yield e._recaptchaLoader.load(e.auth,e.auth.languageCode||void 0);const t=yield function fs(n){return ct.apply(this,arguments)}(e.auth);d(t,e.auth,"internal-error"),e.parameters.sitekey=t})()}getAssertedRecaptcha(){return d(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class yn{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){const t=z._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}function En(){return(En=(0,a.Z)(function*(n,e,t){const r=v(n),i=yield Ue(r,e,(0,l.m9)(t));return new yn(i,s=>Ce(r,s))})).apply(this,arguments)}function Tn(){return(Tn=(0,a.Z)(function*(n,e,t){const r=(0,l.m9)(n);yield be(!1,r,"phone");const i=yield Ue(r.auth,e,(0,l.m9)(t));return new yn(i,s=>Qr(r,s))})).apply(this,arguments)}function Rn(){return(Rn=(0,a.Z)(function*(n,e,t){const r=(0,l.m9)(n),i=yield Ue(r.auth,e,(0,l.m9)(t));return new yn(i,s=>ei(r,s))})).apply(this,arguments)}function Ue(n,e,t){return An.apply(this,arguments)}function An(){return An=(0,a.Z)(function*(n,e,t){var r;const i=yield t.verify();try{let s;if(d("string"==typeof i,n,"argument-error"),d(t.type===ci,n,"argument-error"),s="string"==typeof e?{phoneNumber:e}:e,"session"in s){const o=s.session;if("phoneNumber"in s)return d("enroll"===o.type,n,"internal-error"),(yield function _o(n,e){return g(n,"POST","/v2/accounts/mfaEnrollment:start",m(n,e))}(n,{idToken:o.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:i}})).phoneSessionInfo.sessionInfo;{d("signin"===o.type,n,"internal-error");const u=(null===(r=s.multiFactorHint)||void 0===r?void 0:r.uid)||s.multiFactorUid;return d(u,n,"missing-multi-factor-info"),(yield function Mo(n,e){return g(n,"POST","/v2/accounts/mfaSignIn:start",m(n,e))}(n,{mfaPendingCredential:o.credential,mfaEnrollmentId:u,phoneSignInInfo:{recaptchaToken:i}})).phoneResponseInfo.sessionInfo}}{const{sessionInfo:o}=yield function bs(n,e){return Nt.apply(this,arguments)}(n,{phoneNumber:s.phoneNumber,recaptchaToken:i});return o}}finally{t._reset()}}),An.apply(this,arguments)}function kn(){return(kn=(0,a.Z)(function*(n,e){yield Mt((0,l.m9)(n),e)})).apply(this,arguments)}let ve=(()=>{class n{constructor(t){this.providerId=n.PROVIDER_ID,this.auth=v(t)}verifyPhoneNumber(t,r){return Ue(this.auth,t,(0,l.m9)(r))}static credential(t,r){return z._fromVerification(t,r)}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{phoneNumber:r,temporaryProof:i}=t;return r&&i?z._fromTokenResponse(r,i):null}}return n.PROVIDER_ID="phone",n.PHONE_SIGN_IN_METHOD="phone",n})();function q(n,e){return e?R(e):(d(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}class Pn extends X{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return L(e,this._buildIdpRequest())}_linkToIdToken(e,t){return L(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return L(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function na(n){return Xr(n.auth,new Pn(n),n.bypassAuthState)}function ra(n){const{auth:e,user:t}=n;return d(t,e,"internal-error"),Jr(t,new Pn(n),n.bypassAuthState)}function ia(n){return Sn.apply(this,arguments)}function Sn(){return(Sn=(0,a.Z)(function*(n){const{auth:e,user:t}=n;return d(t,e,"internal-error"),Mt(t,new Pn(n),n.bypassAuthState)})).apply(this,arguments)}class li{constructor(e,t,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){var e=this;return new Promise(function(){var t=(0,a.Z)(function*(r,i){e.pendingPromise={resolve:r,reject:i};try{e.eventManager=yield e.resolver._initialize(e.auth),yield e.onExecution(),e.eventManager.registerConsumer(e)}catch(s){e.reject(s)}});return function(r,i){return t.apply(this,arguments)}}())}onAuthEvent(e){var t=this;return(0,a.Z)(function*(){const{urlResponse:r,sessionId:i,postBody:s,tenantId:o,error:u,type:c}=e;if(u)return void t.reject(u);const h={auth:t.auth,requestUri:r,sessionId:i,tenantId:o||void 0,postBody:s||void 0,user:t.user,bypassAuthState:t.bypassAuthState};try{t.resolve(yield t.getIdpTask(c)(h))}catch(f){t.reject(f)}})()}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return na;case"linkViaPopup":case"linkViaRedirect":return ia;case"reauthViaPopup":case"reauthViaRedirect":return ra;default:y(this.auth,"internal-error")}}resolve(e){P(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){P(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const sa=new ae(2e3,1e4);function Nn(){return(Nn=(0,a.Z)(function*(n,e,t){const r=v(n);K(n,e,D);const i=q(r,t);return new Cn(r,"signInViaPopup",e,i).executeNotNull()})).apply(this,arguments)}function wn(){return(wn=(0,a.Z)(function*(n,e,t){const r=(0,l.m9)(n);K(r.auth,e,D);const i=q(r.auth,t);return new Cn(r.auth,"reauthViaPopup",e,i,r).executeNotNull()})).apply(this,arguments)}function bn(){return(bn=(0,a.Z)(function*(n,e,t){const r=(0,l.m9)(n);K(r.auth,e,D);const i=q(r.auth,t);return new Cn(r.auth,"linkViaPopup",e,i,r).executeNotNull()})).apply(this,arguments)}let Cn=(()=>{class n extends li{constructor(t,r,i,s,o){super(t,r,s,o),this.provider=i,this.authWindow=null,this.pollId=null,n.currentPopupAction&&n.currentPopupAction.cancel(),n.currentPopupAction=this}executeNotNull(){var t=this;return(0,a.Z)(function*(){const r=yield t.execute();return d(r,t.auth,"internal-error"),r})()}onExecution(){var t=this;return(0,a.Z)(function*(){P(1===t.filter.length,"Popup operations only handle one event");const r=_e();t.authWindow=yield t.resolver._openPopup(t.auth,t.provider,t.filter[0],r),t.authWindow.associatedEvent=r,t.resolver._originValidation(t.auth).catch(i=>{t.reject(i)}),t.resolver._isIframeWebStorageSupported(t.auth,i=>{i||t.reject(E(t.auth,"web-storage-unsupported"))}),t.pollUserCancellation()})()}get eventId(){var t;return(null===(t=this.authWindow)||void 0===t?void 0:t.associatedEvent)||null}cancel(){this.reject(E(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,n.currentPopupAction=null}pollUserCancellation(){const t=()=>{var r,i;this.pollId=null!==(i=null===(r=this.authWindow)||void 0===r?void 0:r.window)&&void 0!==i&&i.closed?window.setTimeout(()=>{this.pollId=null,this.reject(E(this.auth,"popup-closed-by-user"))},8e3):window.setTimeout(t,sa.get())};t()}}return n.currentPopupAction=null,n})();const ca="pendingRedirect",Ie=new Map;class la extends li{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}execute(){var e=()=>super.execute,t=this;return(0,a.Z)(function*(){let r=Ie.get(t.auth._key());if(!r){try{const s=(yield function da(n,e){return On.apply(this,arguments)}(t.resolver,t.auth))?yield e().call(t):null;r=()=>Promise.resolve(s)}catch(i){r=()=>Promise.reject(i)}Ie.set(t.auth._key(),r)}return t.bypassAuthState||Ie.set(t.auth._key(),()=>Promise.resolve(null)),r()})()}onAuthEvent(e){var t=()=>super.onAuthEvent,r=this;return(0,a.Z)(function*(){if("signInViaRedirect"===e.type)return t().call(r,e);if("unknown"!==e.type){if(e.eventId){const i=yield r.auth._redirectUserForId(e.eventId);if(i)return r.user=i,t().call(r,e);r.resolve(null)}}else r.resolve(null)})()}onExecution(){return(0,a.Z)(function*(){})()}cleanUp(){}}function On(){return(On=(0,a.Z)(function*(n,e){const t=hi(e),r=di(n);if(!(yield r._isAvailable()))return!1;const i="true"===(yield r._get(t));return yield r._remove(t),i})).apply(this,arguments)}function Ln(n,e){return Dn.apply(this,arguments)}function Dn(){return(Dn=(0,a.Z)(function*(n,e){return di(n)._set(hi(e),"true")})).apply(this,arguments)}function xn(n,e){Ie.set(n._key(),e)}function di(n){return R(n._redirectPersistence)}function hi(n){return H(ca,n.config.apiKey,n.name)}function fa(n,e,t){return function pa(n,e,t){return Mn.apply(this,arguments)}(n,e,t)}function Mn(){return(Mn=(0,a.Z)(function*(n,e,t){const r=v(n);K(n,e,D),yield r._initializationPromise;const i=q(r,t);return yield Ln(i,r),i._openRedirect(r,e,"signInViaRedirect")})).apply(this,arguments)}function ma(n,e,t){return function _a(n,e,t){return Un.apply(this,arguments)}(n,e,t)}function Un(){return(Un=(0,a.Z)(function*(n,e,t){const r=(0,l.m9)(n);K(r.auth,e,D),yield r.auth._initializationPromise;const i=q(r.auth,t);yield Ln(i,r.auth);const s=yield fi(r);return i._openRedirect(r.auth,e,"reauthViaRedirect",s)})).apply(this,arguments)}function ga(n,e,t){return function va(n,e,t){return Fn.apply(this,arguments)}(n,e,t)}function Fn(){return(Fn=(0,a.Z)(function*(n,e,t){const r=(0,l.m9)(n);K(r.auth,e,D),yield r.auth._initializationPromise;const i=q(r.auth,t);yield be(!1,r,e.providerId),yield Ln(i,r.auth);const s=yield fi(r);return i._openRedirect(r.auth,e,"linkViaRedirect",s)})).apply(this,arguments)}function Vn(){return(Vn=(0,a.Z)(function*(n,e){return yield v(n)._initializationPromise,Fe(n,e,!1)})).apply(this,arguments)}function Fe(n,e){return Zn.apply(this,arguments)}function Zn(){return(Zn=(0,a.Z)(function*(n,e,t=!1){const r=v(n),i=q(r,e),o=yield new la(r,i,t).execute();return o&&!t&&(delete o.user._redirectEventId,yield r._persistUserIfCurrent(o.user),yield r._setRedirectUser(null,e)),o})).apply(this,arguments)}function fi(n){return Wn.apply(this,arguments)}function Wn(){return(Wn=(0,a.Z)(function*(n){const e=_e(`${n.uid}:::`);return n._redirectEventId=e,yield n.auth._setRedirectUser(n),yield n.auth._persistUserIfCurrent(n),e})).apply(this,arguments)}class pi{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function Ea(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return _i(n);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!_i(e)){const i=(null===(r=e.error.code)||void 0===r?void 0:r.split("auth/")[1])||"internal-error";t.onError(E(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(mi(e))}saveEventToCache(e){this.cachedEventUids.add(mi(e)),this.lastProcessedEventTime=Date.now()}}function mi(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function _i({type:n,error:e}){return"unknown"===n&&"auth/no-auth-event"===(null==e?void 0:e.code)}function gi(n){return Hn.apply(this,arguments)}function Hn(){return(Hn=(0,a.Z)(function*(n,e={}){return g(n,"GET","/v1/projects",e)})).apply(this,arguments)}const Ta=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ra=/^https?/;function zn(){return(zn=(0,a.Z)(function*(n){if(n.config.emulator)return;const{authorizedDomains:e}=yield gi(n);for(const t of e)try{if(ka(t))return}catch{}y(n,"unauthorized-domain")})).apply(this,arguments)}function ka(n){const e=oe(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return""===o.hostname&&""===r?"chrome-extension:"===t&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===t&&o.hostname===r}if(!Ra.test(t))return!1;if(Ta.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const Pa=new ae(3e4,6e4);function vi(){const n=I().___jsl;if(null!=n&&n.H)for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}let Ve=null;const wa=new ae(5e3,15e3),ba="__/auth/iframe",Ca="emulator/auth/iframe",Oa={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},La=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Da(n){const e=n.config;d(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?je(e,Ca):`https://${n.config.authDomain}/${ba}`,r={apiKey:e.apiKey,appName:n.name,v:b.SDK_VERSION},i=La.get(n.config.apiHost);i&&(r.eid=i);const s=n._getFrameworks();return s.length&&(r.fw=s.join(",")),`${t}?${(0,l.xO)(r).slice(1)}`}function Gn(){return Gn=(0,a.Z)(function*(n){const e=yield function Na(n){return Ve=Ve||function Sa(n){return new Promise((e,t)=>{var r,i,s;function o(){vi(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{vi(),t(E(n,"network-request-failed"))},timeout:Pa.get()})}if(null!==(i=null===(r=I().gapi)||void 0===r?void 0:r.iframes)&&void 0!==i&&i.Iframe)e(gapi.iframes.getContext());else{if(null===(s=I().gapi)||void 0===s||!s.load){const u=Mr("iframefcb");return I()[u]=()=>{gapi.load?o():t(E(n,"network-request-failed"))},dt(`https://apis.google.com/js/api.js?onload=${u}`).catch(c=>t(c))}o()}}).catch(e=>{throw Ve=null,e})}(n),Ve}(n),t=I().gapi;return d(t,n,"internal-error"),e.open({where:document.body,url:Da(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Oa,dontclear:!0},r=>new Promise(function(){var i=(0,a.Z)(function*(s,o){yield r.restyle({setHideOnLeave:!1});const u=E(n,"network-request-failed"),c=I().setTimeout(()=>{o(u)},wa.get());function h(){I().clearTimeout(c),s(r)}r.ping(h).then(h,()=>{o(u)})});return function(s,o){return i.apply(this,arguments)}}()))}),Gn.apply(this,arguments)}const Ma={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Ua=500,Fa=600,Va="_blank",Za="http://localhost";class Ii{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}const za="__/auth/handler",Ga="emulator/auth/handler",qa=encodeURIComponent("fac");function qn(n,e,t,r,i,s){return $n.apply(this,arguments)}function $n(){return($n=(0,a.Z)(function*(n,e,t,r,i,s){d(n.config.authDomain,n,"auth-domain-config-required"),d(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:b.SDK_VERSION,eventId:i};if(e instanceof D){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",(0,l.xb)(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[f,p]of Object.entries(s||{}))o[f]=p}if(e instanceof Q){const f=e.getScopes().filter(p=>""!==p);f.length>0&&(o.scopes=f.join(","))}n.tenantId&&(o.tid=n.tenantId);const u=o;for(const f of Object.keys(u))void 0===u[f]&&delete u[f];const c=yield n._getAppCheckToken(),h=c?`#${qa}=${encodeURIComponent(c)}`:"";return`${function $a({config:n}){return n.emulator?je(n,Ga):`https://${n.authDomain}/${za}`}(n)}?${(0,l.xO)(u).slice(1)}${h}`})).apply(this,arguments)}const Bn="webStorageSupport",yi=class Ba{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=V,this._completeRedirectFn=Fe,this._overrideRedirectResult=xn}_openPopup(e,t,r,i){var s=this;return(0,a.Z)(function*(){var o;P(null===(o=s.eventManagers[e._key()])||void 0===o?void 0:o.manager,"_initialize() not called before _openPopup()");const u=yield qn(e,t,r,oe(),i);return function Wa(n,e,t,r=Ua,i=Fa){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let u="";const c=Object.assign(Object.assign({},Ma),{width:r.toString(),height:i.toString(),top:s,left:o}),h=(0,l.z$)().toLowerCase();t&&(u=Pr(h)?Va:t),kr(h)&&(e=e||Za,c.scrollbars="yes");const f=Object.entries(c).reduce((_,[S,He])=>`${_}${S}=${He},`,"");if(function ls(n=(0,l.z$)()){var e;return J(n)&&!(null===(e=window.navigator)||void 0===e||!e.standalone)}(h)&&"_self"!==u)return function Ha(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}(e||"",u),new Ii(null);const p=window.open(e||"",u,f);d(p,n,"popup-blocked");try{p.focus()}catch{}return new Ii(p)}(e,u,_e())})()}_openRedirect(e,t,r,i){var s=this;return(0,a.Z)(function*(){return yield s._originValidation(e),function So(n){I().location.href=n}(yield qn(e,t,r,oe(),i)),new Promise(()=>{})})()}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:s}=this.eventManagers[t];return i?Promise.resolve(i):(P(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}initAndGetManager(e){var t=this;return(0,a.Z)(function*(){const r=yield function xa(n){return Gn.apply(this,arguments)}(e),i=new pi(e);return r.register("authEvent",s=>(d(null==s?void 0:s.authEvent,e,"invalid-auth-event"),{status:i.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),t.eventManagers[e._key()]={manager:i},t.iframes[e._key()]=r,i})()}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Bn,{type:Bn},i=>{var s;const o=null===(s=null==i?void 0:i[0])||void 0===s?void 0:s[Bn];void 0!==o&&t(!!o),y(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=function Aa(n){return zn.apply(this,arguments)}(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return br()||ut()||J()}};class Ka{constructor(e){this.factorId=e}_process(e,t,r){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,r);case"signin":return this._finalizeSignIn(e,t.credential);default:return N("unexpected MultiFactorSessionType")}}}class Kn extends Ka{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new Kn(e)}_finalizeEnroll(e,t,r){return function go(n,e){return g(n,"POST","/v2/accounts/mfaEnrollment:finalize",m(n,e))}(e,{idToken:t,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return function Uo(n,e){return g(n,"POST","/v2/accounts/mfaSignIn:finalize",m(n,e))}(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}let ja=(()=>{class n{constructor(){}static assertion(t){return Kn._fromCredential(t)}}return n.FACTOR_ID="phone",n})();var Ti="@firebase/auth";class Ya{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}getToken(e){var t=this;return(0,a.Z)(function*(){return t.assertAuthConfigured(),yield t.auth._initializationPromise,t.auth.currentUser?{accessToken:yield t.auth.currentUser.getIdToken(e)}:null})()}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e((null==r?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){d(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}function $(){return window}(0,l.Pz)("authIdTokenMaxAge"),function Xa(n){(0,b._registerComponent)(new $e.wA("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:u}=r.options;d(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const c={apiKey:o,authDomain:u,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Cr(n)},h=new Is(r,i,s,c);return function Es(n,e){const t=(null==e?void 0:e.persistence)||[],r=(Array.isArray(t)?t:[t]).map(R);null!=e&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,null==e?void 0:e.popupRedirectResolver)}(h,t),h},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),(0,b._registerComponent)(new $e.wA("auth-internal",e=>{const t=v(e.getProvider("auth").getImmediate());return new Ya(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),(0,b.registerVersion)(Ti,"0.23.2",function Ja(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(n)),(0,b.registerVersion)(Ti,"0.23.2","esm2017")}("Browser");const nu=2e3;function Yn(){return Yn=(0,a.Z)(function*(n,e,t){var r;const{BuildInfo:i}=$();P(e.sessionId,"AuthEvent did not contain a session ID");const s=yield function uu(n){return Qn.apply(this,arguments)}(e.sessionId),o={};return J()?o.ibi=i.packageName:he()?o.apn=i.packageName:y(n,"operation-not-supported-in-this-environment"),i.displayName&&(o.appDisplayName=i.displayName),o.sessionId=s,qn(n,t,e.type,void 0,null!==(r=e.eventId)&&void 0!==r?r:void 0,o)}),Yn.apply(this,arguments)}function Jn(){return(Jn=(0,a.Z)(function*(n){const{BuildInfo:e}=$(),t={};J()?t.iosBundleId=e.packageName:he()?t.androidPackageName=e.packageName:y(n,"operation-not-supported-in-this-environment"),yield gi(n,t)})).apply(this,arguments)}function Xn(){return(Xn=(0,a.Z)(function*(n,e,t){const{cordova:r}=$();let i=()=>{};try{yield new Promise((s,o)=>{let u=null;function c(){var p;s();const _=null===(p=r.plugins.browsertab)||void 0===p?void 0:p.close;"function"==typeof _&&_(),"function"==typeof(null==t?void 0:t.close)&&t.close()}function h(){u||(u=window.setTimeout(()=>{o(E(n,"redirect-cancelled-by-user"))},nu))}function f(){"visible"===(null==document?void 0:document.visibilityState)&&h()}e.addPassiveListener(c),document.addEventListener("resume",h,!1),he()&&document.addEventListener("visibilitychange",f,!1),i=()=>{e.removePassiveListener(c),document.removeEventListener("resume",h,!1),document.removeEventListener("visibilitychange",f,!1),u&&window.clearTimeout(u)}})}finally{i()}})).apply(this,arguments)}function Qn(){return(Qn=(0,a.Z)(function*(n){const e=function cu(n){if(P(/[0-9a-zA-Z]+/.test(n),"Can only convert alpha-numeric strings"),typeof TextEncoder<"u")return(new TextEncoder).encode(n);const e=new ArrayBuffer(n.length),t=new Uint8Array(e);for(let r=0;r<n.length;r++)t[r]=n.charCodeAt(r);return t}(n),t=yield crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(i=>i.toString(16).padStart(2,"0")).join("")})).apply(this,arguments)}const lu=20;class du extends pi{constructor(){super(...arguments),this.passiveListeners=new Set,this.initPromise=new Promise(e=>{this.resolveInialized=e})}addPassiveListener(e){this.passiveListeners.add(e)}removePassiveListener(e){this.passiveListeners.delete(e)}resetRedirect(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1}onEvent(e){return this.resolveInialized(),this.passiveListeners.forEach(t=>t(e)),super.onEvent(e)}initialized(){var e=this;return(0,a.Z)(function*(){yield e.initPromise})()}}function ki(n){return er.apply(this,arguments)}function er(){return(er=(0,a.Z)(function*(n){const e=yield tr()._get(nr(n));return e&&(yield tr()._remove(nr(n))),e})).apply(this,arguments)}function mu(){const n=[],e="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let t=0;t<lu;t++){const r=Math.floor(Math.random()*e.length);n.push(e.charAt(r))}return n.join("")}function tr(){return R(Le)}function nr(n){return H("authEvent",n.config.apiKey,n.name)}function We(n){if(null==n||!n.includes("?"))return{};const[e,...t]=n.split("?");return(0,l.zd)(t.join("?"))}const yu=class Iu{constructor(){this._redirectPersistence=V,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=Fe,this._overrideRedirectResult=xn}_initialize(e){var t=this;return(0,a.Z)(function*(){const r=e._key();let i=t.eventManagers.get(r);return i||(i=new du(e),t.eventManagers.set(r,i),t.attachCallbackListeners(e,i)),i})()}_openPopup(e){y(e,"operation-not-supported-in-this-environment")}_openRedirect(e,t,r,i){var s=this;return(0,a.Z)(function*(){!function au(n){var e,t,r,i,s,o,u,c,h,f;const p=$();d("function"==typeof(null===(e=null==p?void 0:p.universalLinks)||void 0===e?void 0:e.subscribe),n,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),d(typeof(null===(t=null==p?void 0:p.BuildInfo)||void 0===t?void 0:t.packageName)<"u",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),d("function"==typeof(null===(s=null===(i=null===(r=null==p?void 0:p.cordova)||void 0===r?void 0:r.plugins)||void 0===i?void 0:i.browsertab)||void 0===s?void 0:s.openUrl),n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),d("function"==typeof(null===(c=null===(u=null===(o=null==p?void 0:p.cordova)||void 0===o?void 0:o.plugins)||void 0===u?void 0:u.browsertab)||void 0===c?void 0:c.isAvailable),n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),d("function"==typeof(null===(f=null===(h=null==p?void 0:p.cordova)||void 0===h?void 0:h.InAppBrowser)||void 0===f?void 0:f.open),n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"})}(e);const o=yield s._initialize(e);yield o.initialized(),o.resetRedirect(),function ha(){Ie.clear()}(),yield s._originValidation(e);const u=function hu(n,e,t=null){return{type:e,eventId:t,urlResponse:null,sessionId:mu(),postBody:null,tenantId:n.tenantId,error:E(n,"no-auth-event")}}(e,r,i);yield function fu(n,e){return tr()._set(nr(n),e)}(e,u);const c=yield function ru(n,e,t){return Yn.apply(this,arguments)}(e,u,t),h=yield function su(n){const{cordova:e}=$();return new Promise(t=>{e.plugins.browsertab.isAvailable(r=>{let i=null;r?e.plugins.browsertab.openUrl(n):i=e.InAppBrowser.open(n,function cs(n=(0,l.z$)()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(n)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(n)}()?"_blank":"_system","location=yes"),t(i)})})}(c);return function ou(n,e,t){return Xn.apply(this,arguments)}(e,o,h)})()}_isIframeWebStorageSupported(e,t){throw new Error("Method not implemented.")}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=function iu(n){return Jn.apply(this,arguments)}(e)),this.originValidationPromises[t]}attachCallbackListeners(e,t){const{universalLinks:r,handleOpenURL:i,BuildInfo:s}=$(),o=setTimeout((0,a.Z)(function*(){yield ki(e),t.onEvent(Pi())}),500),u=function(){var f=(0,a.Z)(function*(p){clearTimeout(o);const _=yield ki(e);let S=null;_&&null!=p&&p.url&&(S=function pu(n,e){var t,r;const i=function gu(n){const e=We(n),t=e.link?decodeURIComponent(e.link):void 0,r=We(t).link,i=e.deep_link_id?decodeURIComponent(e.deep_link_id):void 0;return We(i).link||i||r||t||n}(e);if(i.includes("/__/auth/callback")){const s=We(i),o=s.firebaseError?function _u(n){try{return JSON.parse(n)}catch{return null}}(decodeURIComponent(s.firebaseError)):null,u=null===(r=null===(t=null==o?void 0:o.code)||void 0===t?void 0:t.split("auth/"))||void 0===r?void 0:r[1],c=u?E(u):null;return c?{type:n.type,eventId:n.eventId,tenantId:n.tenantId,error:c,urlResponse:null,sessionId:null,postBody:null}:{type:n.type,eventId:n.eventId,tenantId:n.tenantId,sessionId:n.sessionId,urlResponse:i,postBody:null}}return null}(_,p.url)),t.onEvent(S||Pi())});return function(_){return f.apply(this,arguments)}}();typeof r<"u"&&"function"==typeof r.subscribe&&r.subscribe(null,u);const c=i,h=`${s.packageName.toLowerCase()}://`;$().handleOpenURL=function(){var f=(0,a.Z)(function*(p){if(p.toLowerCase().startsWith(h)&&u({url:p}),"function"==typeof c)try{c(p)}catch(_){console.error(_)}});return function(p){return f.apply(this,arguments)}}()}};function Pi(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:E("no-auth-event")}}const Au=1e3;function ye(){var n;return(null===(n=null==self?void 0:self.location)||void 0===n?void 0:n.protocol)||null}function Si(n=(0,l.z$)()){return!("file:"!==ye()&&"ionic:"!==ye()&&"capacitor:"!==ye()||!n.toLowerCase().match(/iphone|ipad|ipod|android/))}function Ni(){try{const n=self.localStorage,e=_e();if(n)return n.setItem(e,"1"),n.removeItem(e),!function wu(n=(0,l.z$)()){return function Su(){return(0,l.w1)()&&11===(null==document?void 0:document.documentMode)}()||function Nu(n=(0,l.z$)()){return/Edge\/\d+/.test(n)}(n)}()||(0,l.hl)()}catch{return rr()&&(0,l.hl)()}return!1}function rr(){return typeof global<"u"&&"WorkerGlobalScope"in global&&"importScripts"in global}function ir(){return(function ku(){return"http:"===ye()||"https:"===ye()}()||(0,l.ru)()||Si())&&!function Pu(){return(0,l.b$)()||(0,l.UG)()}()&&Ni()&&!rr()}function wi(){return Si()&&typeof document<"u"}function sr(){return(sr=(0,a.Z)(function*(){return!!wi()&&new Promise(n=>{const e=setTimeout(()=>{n(!1)},Au);document.addEventListener("deviceready",()=>{clearTimeout(e),n(!0)})})})).apply(this,arguments)}const A={LOCAL:"local",NONE:"none",SESSION:"session"},Ee=d,bi="persistence";function or(n){return ar.apply(this,arguments)}function ar(){return(ar=(0,a.Z)(function*(n){yield n._initializationPromise;const e=Ci(),t=H(bi,n.config.apiKey,n.name);e&&e.setItem(t,n._getPersistence())})).apply(this,arguments)}function Ci(){var n;try{return(null===(n=function Cu(){return typeof window<"u"?window:null}())||void 0===n?void 0:n.sessionStorage)||null}catch{return null}}const Du=d;class Z{constructor(){this.browserResolver=R(yi),this.cordovaResolver=R(yu),this.underlyingResolver=null,this._redirectPersistence=V,this._completeRedirectFn=Fe,this._overrideRedirectResult=xn}_initialize(e){var t=this;return(0,a.Z)(function*(){return yield t.selectUnderlyingResolver(),t.assertedUnderlyingResolver._initialize(e)})()}_openPopup(e,t,r,i){var s=this;return(0,a.Z)(function*(){return yield s.selectUnderlyingResolver(),s.assertedUnderlyingResolver._openPopup(e,t,r,i)})()}_openRedirect(e,t,r,i){var s=this;return(0,a.Z)(function*(){return yield s.selectUnderlyingResolver(),s.assertedUnderlyingResolver._openRedirect(e,t,r,i)})()}_isIframeWebStorageSupported(e,t){this.assertedUnderlyingResolver._isIframeWebStorageSupported(e,t)}_originValidation(e){return this.assertedUnderlyingResolver._originValidation(e)}get _shouldInitProactively(){return wi()||this.browserResolver._shouldInitProactively}get assertedUnderlyingResolver(){return Du(this.underlyingResolver,"internal-error"),this.underlyingResolver}selectUnderlyingResolver(){var e=this;return(0,a.Z)(function*(){if(e.underlyingResolver)return;const t=yield function bu(){return sr.apply(this,arguments)}();e.underlyingResolver=t?e.cordovaResolver:e.browserResolver})()}}function Oi(n){return n.unwrap()}function Mu(n){return Li(n)}function Li(n){const{_tokenResponse:e}=n instanceof l.ZR?n.customData:n;if(!e)return null;if(!(n instanceof l.ZR)&&"temporaryProof"in e&&"phoneNumber"in e)return ve.credentialFromResult(n);const t=e.providerId;if(!t||t===se.PASSWORD)return null;let r;switch(t){case se.GOOGLE:r=qr;break;case se.FACEBOOK:r=Gr;break;case se.GITHUB:r=$r;break;case se.TWITTER:r=Br;break;default:const{oauthIdToken:i,oauthAccessToken:s,oauthTokenSecret:o,pendingToken:u,nonce:c}=e;return s||o||i||u?u?t.startsWith("saml.")?te._create(t,u):w._fromParams({providerId:t,signInMethod:t,pendingToken:u,idToken:i,accessToken:s}):new ee(t).credential({idToken:i,accessToken:s,rawNonce:c}):null}return n instanceof l.ZR?r.credentialFromError(n):r.credentialFromResult(n)}function T(n,e){return e.catch(t=>{throw t instanceof l.ZR&&function Uu(n,e){var t;const r=null===(t=e.customData)||void 0===t?void 0:t._tokenResponse;if("auth/multi-factor-auth-required"===(null==e?void 0:e.code))e.resolver=new Fu(n,function mo(n,e){var t;const r=(0,l.m9)(n),i=e;return d(e.customData.operationType,r,"argument-error"),d(null===(t=i.customData._serverResponse)||void 0===t?void 0:t.mfaPendingCredential,r,"argument-error"),dn._fromError(r,i)}(n,e));else if(r){const i=Li(e),s=e;i&&(s.credential=i,s.tenantId=r.tenantId||void 0,s.email=r.email||void 0,s.phoneNumber=r.phoneNumber||void 0)}}(n,t),t}).then(t=>{const i=t.user;return{operationType:t.operationType,credential:Mu(t),additionalUserInfo:ho(t),user:x.getOrCreate(i)}})}function ur(n,e){return cr.apply(this,arguments)}function cr(){return(cr=(0,a.Z)(function*(n,e){const t=yield e;return{verificationId:t.verificationId,confirm:r=>T(n,t.confirm(r))}})).apply(this,arguments)}class Fu{constructor(e,t){this.resolver=t,this.auth=function xu(n){return n.wrapped()}(e)}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(e){return T(Oi(this.auth),this.resolver.resolveSignIn(e))}}class x{constructor(e){this._delegate=e,this.multiFactor=function yo(n){const e=(0,l.m9)(n);return fn.has(e)||fn.set(e,hn._fromUser(e)),fn.get(e)}(e)}static getOrCreate(e){return x.USER_MAP.has(e)||x.USER_MAP.set(e,new x(e)),x.USER_MAP.get(e)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(e){return this._delegate.getIdTokenResult(e)}getIdToken(e){return this._delegate.getIdToken(e)}linkAndRetrieveDataWithCredential(e){return this.linkWithCredential(e)}linkWithCredential(e){var t=this;return(0,a.Z)(function*(){return T(t.auth,Qr(t._delegate,e))})()}linkWithPhoneNumber(e,t){var r=this;return(0,a.Z)(function*(){return ur(r.auth,function Qo(n,e,t){return Tn.apply(this,arguments)}(r._delegate,e,t))})()}linkWithPopup(e){var t=this;return(0,a.Z)(function*(){return T(t.auth,function ua(n,e,t){return bn.apply(this,arguments)}(t._delegate,e,Z))})()}linkWithRedirect(e){var t=this;return(0,a.Z)(function*(){return yield or(v(t.auth)),ga(t._delegate,e,Z)})()}reauthenticateAndRetrieveDataWithCredential(e){return this.reauthenticateWithCredential(e)}reauthenticateWithCredential(e){var t=this;return(0,a.Z)(function*(){return T(t.auth,ei(t._delegate,e))})()}reauthenticateWithPhoneNumber(e,t){return ur(this.auth,function ea(n,e,t){return Rn.apply(this,arguments)}(this._delegate,e,t))}reauthenticateWithPopup(e){return T(this.auth,function aa(n,e,t){return wn.apply(this,arguments)}(this._delegate,e,Z))}reauthenticateWithRedirect(e){var t=this;return(0,a.Z)(function*(){return yield or(v(t.auth)),ma(t._delegate,e,Z)})()}sendEmailVerification(e){return function eo(n,e){return sn.apply(this,arguments)}(this._delegate,e)}unlink(e){var t=this;return(0,a.Z)(function*(){return yield function Zs(n,e){return xt.apply(this,arguments)}(t._delegate,e),t})()}updateEmail(e){return function io(n,e){return ni((0,l.m9)(n),e,null)}(this._delegate,e)}updatePassword(e){return function so(n,e){return ni((0,l.m9)(n),null,e)}(this._delegate,e)}updatePhoneNumber(e){return function ta(n,e){return kn.apply(this,arguments)}(this._delegate,e)}updateProfile(e){return function ro(n,e){return un.apply(this,arguments)}(this._delegate,e)}verifyBeforeUpdateEmail(e,t){return function to(n,e,t){return on.apply(this,arguments)}(this._delegate,e,t)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}}x.USER_MAP=new WeakMap;const Te=d;let Di=(()=>{class n{constructor(t,r){if(this.app=t,r.isInitialized())return this._delegate=r.getImmediate(),void this.linkUnderlyingAuth();const{apiKey:i}=t.options;Te(i,"invalid-api-key",{appName:t.name}),Te(i,"invalid-api-key",{appName:t.name});const s=typeof window<"u"?Z:void 0;this._delegate=r.initialize({options:{persistence:Vu(i,t.name),popupRedirectResolver:s}}),this._delegate._updateErrorMap(Gi),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?x.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(t){this._delegate.languageCode=t}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(t){this._delegate.tenantId=t}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(t,r){!function Vr(n,e,t){const r=v(n);d(r._canInitEmulator,r,"emulator-config-failed"),d(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!(null==t||!t.disableWarnings),s=Zr(e),{host:o,port:u}=function Ts(n){const e=Zr(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:Wr(r.substr(s.length+1))}}{const[s,o]=r.split(":");return{host:s,port:Wr(o)}}}(e);r.config.emulator={url:`${s}//${o}${null===u?"":`:${u}`}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:u,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function Rs(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&"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."),typeof window<"u"&&typeof document<"u"&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",n):n())}()}(this._delegate,t,r)}applyActionCode(t){return function qs(n,e){return Yt.apply(this,arguments)}(this._delegate,t)}checkActionCode(t){return ti(this._delegate,t)}confirmPasswordReset(t,r){return function Gs(n,e,t){return jt.apply(this,arguments)}(this._delegate,t,r)}createUserWithEmailAndPassword(t,r){var i=this;return(0,a.Z)(function*(){return T(i._delegate,function Bs(n,e,t){return Qt.apply(this,arguments)}(i._delegate,t,r))})()}fetchProvidersForEmail(t){return this.fetchSignInMethodsForEmail(t)}fetchSignInMethodsForEmail(t){return function Qs(n,e){return rn.apply(this,arguments)}(this._delegate,t)}isSignInWithEmailLink(t){return function Ys(n,e){const t=pe.parseLink(e);return"EMAIL_SIGNIN"===(null==t?void 0:t.operation)}(0,t)}getRedirectResult(){var t=this;return(0,a.Z)(function*(){Te(ir(),t._delegate,"operation-not-supported-in-this-environment");const r=yield function Ia(n,e){return Vn.apply(this,arguments)}(t._delegate,Z);return r?T(t._delegate,Promise.resolve(r)):{credential:null,user:null}})()}addFrameworkForLogging(t){!function Eu(n,e){v(n)._logFramework(e)}(this._delegate,t)}onAuthStateChanged(t,r,i){const{next:s,error:o,complete:u}=xi(t,r,i);return this._delegate.onAuthStateChanged(s,o,u)}onIdTokenChanged(t,r,i){const{next:s,error:o,complete:u}=xi(t,r,i);return this._delegate.onIdTokenChanged(s,o,u)}sendSignInLinkToEmail(t,r){return function js(n,e,t){return en.apply(this,arguments)}(this._delegate,t,r)}sendPasswordResetEmail(t,r){return function zs(n,e,t){return Kt.apply(this,arguments)}(this._delegate,t,r||void 0)}setPersistence(t){var r=this;return(0,a.Z)(function*(){let i;switch(function Ou(n,e){Ee(Object.values(A).includes(e),n,"invalid-persistence-type"),(0,l.b$)()?Ee(e!==A.SESSION,n,"unsupported-persistence-type"):(0,l.UG)()?Ee(e===A.NONE,n,"unsupported-persistence-type"):rr()?Ee(e===A.NONE||e===A.LOCAL&&(0,l.hl)(),n,"unsupported-persistence-type"):Ee(e===A.NONE||Ni(),n,"unsupported-persistence-type")}(r._delegate,t),t){case A.SESSION:i=V;break;case A.LOCAL:i=(yield R(ie)._isAvailable())?ie:Le;break;case A.NONE:i=j;break;default:return y("argument-error",{appName:r._delegate.name})}return r._delegate.setPersistence(i)})()}signInAndRetrieveDataWithCredential(t){return this.signInWithCredential(t)}signInAnonymously(){return T(this._delegate,function Vs(n){return Dt.apply(this,arguments)}(this._delegate))}signInWithCredential(t){return T(this._delegate,Ce(this._delegate,t))}signInWithCustomToken(t){return T(this._delegate,function Hs(n,e){return qt.apply(this,arguments)}(this._delegate,t))}signInWithEmailAndPassword(t,r){return T(this._delegate,function Ks(n,e,t){return Ce((0,l.m9)(n),Ot.credential(e,t))}(this._delegate,t,r))}signInWithEmailLink(t,r){return T(this._delegate,function Js(n,e,t){return tn.apply(this,arguments)}(this._delegate,t,r))}signInWithPhoneNumber(t,r){return ur(this._delegate,function Xo(n,e,t){return En.apply(this,arguments)}(this._delegate,t,r))}signInWithPopup(t){var r=this;return(0,a.Z)(function*(){return Te(ir(),r._delegate,"operation-not-supported-in-this-environment"),T(r._delegate,function oa(n,e,t){return Nn.apply(this,arguments)}(r._delegate,t,Z))})()}signInWithRedirect(t){var r=this;return(0,a.Z)(function*(){return Te(ir(),r._delegate,"operation-not-supported-in-this-environment"),yield or(r._delegate),fa(r._delegate,t,Z)})()}updateCurrentUser(t){return this._delegate.updateCurrentUser(t)}verifyPasswordResetCode(t){return function $s(n,e){return Xt.apply(this,arguments)}(this._delegate,t)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}return n.Persistence=A,n})();function xi(n,e,t){let r=n;"function"!=typeof n&&({next:r,error:e,complete:t}=n);const i=r;return{next:o=>i(o&&x.getOrCreate(o)),error:e,complete:t}}function Vu(n,e){const t=function Lu(n,e){const t=Ci();if(!t)return[];const r=H(bi,n,e);switch(t.getItem(r)){case A.NONE:return[j];case A.LOCAL:return[ie,V];case A.SESSION:return[V];default:return[]}}(n,e);if(typeof self<"u"&&!t.includes(ie)&&t.push(ie),typeof window<"u")for(const r of[Le,V])t.includes(r)||t.push(r);return t.includes(j)||t.push(j),t}class lr{constructor(){this.providerId="phone",this._delegate=new ve(Oi(ze.Z.auth()))}static credential(e,t){return ve.credential(e,t)}verifyPhoneNumber(e,t){return this._delegate.verifyPhoneNumber(e,t)}unwrap(){return this._delegate}}lr.PHONE_SIGN_IN_METHOD=ve.PHONE_SIGN_IN_METHOD,lr.PROVIDER_ID=ve.PROVIDER_ID;const Zu=d;class Wu{constructor(e,t,r=ze.Z.app()){var i;Zu(null===(i=r.options)||void 0===i?void 0:i.apiKey,"invalid-api-key",{appName:r.name}),this._delegate=new Yo(e,t,r.auth()),this.type=this._delegate.type}clear(){this._delegate.clear()}render(){return this._delegate.render()}verify(){return this._delegate.verify()}}!function zu(n){n.INTERNAL.registerComponent(new $e.wA("auth-compat",e=>{const t=e.getProvider("app-compat").getImmediate(),r=e.getProvider("auth");return new Di(t,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:B_EMAIL_SIGNIN,PASSWORD_RESET:B_PASSWORD_RESET,RECOVER_EMAIL:B_RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:B_REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:B_VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:B_VERIFY_EMAIL}},EmailAuthProvider:Ot,FacebookAuthProvider:Gr,GithubAuthProvider:$r,GoogleAuthProvider:qr,OAuthProvider:ee,SAMLAuthProvider:Se,PhoneAuthProvider:lr,PhoneMultiFactorGenerator:ja,RecaptchaVerifier:Wu,TwitterAuthProvider:Br,Auth:Di,AuthCredential:X,Error:l.ZR}).setInstantiationMode("LAZY").setMultipleInstances(!1)),n.registerVersion("@firebase/auth-compat","0.4.2")}(ze.Z)}}]);