PageSourceSearch

https://www.eldebate.com/assets/js_common_private_area.bundle.js?1782465702

js eldebate.com collected 2026-09-24 08:39:32 UTC 773,431 bytes, 1 lines download raw bytes

1!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/assets/",n(n.s=223)}({0:function(e,t,n){"use strict";n.d(t,"a",function(){return dt}),n.d(t,"b",function(){return d}),n.d(t,"c",function(){return dn}),n.d(t,"d",function(){return fn}),n.d(t,"e",function(){return pn}),n.d(t,"f",function(){return mn}),n.d(t,"g",function(){return u}),n.d(t,"h",function(){return f}),n.d(t,"i",function(){return p}),n.d(t,"j",function(){return g}),n.d(t,"k",function(){return Fe}),n.d(t,"l",function(){return Ue}),n.d(t,"m",function(){return Be}),n.d(t,"n",function(){return Ye}),n.d(t,"o",function(){return Xe}),n.d(t,"p",function(){return h}),n.d(t,"q",function(){return er}),n.d(t,"r",function(){return et}),n.d(t,"s",function(){return $n}),n.d(t,"t",function(){return c}),n.d(t,"u",function(){return Qr}),n.d(t,"v",function(){return fe}),n.d(t,"w",function(){return rt}),n.d(t,"x",function(){return at}),n.d(t,"y",function(){return ut}),n.d(t,"z",function(){return lt}),n.d(t,"A",function(){return st}),n.d(t,"B",function(){return ht}),n.d(t,"C",function(){return An}),n.d(t,"D",function(){return gt}),n.d(t,"E",function(){return St}),n.d(t,"F",function(){return At}),n.d(t,"G",function(){return Ct}),n.d(t,"H",function(){return kt}),n.d(t,"I",function(){return Pt}),n.d(t,"J",function(){return Lt}),n.d(t,"K",function(){return jt}),n.d(t,"L",function(){return qt}),n.d(t,"M",function(){return Mt}),n.d(t,"N",function(){return Se}),n.d(t,"O",function(){return b}),n.d(t,"P",function(){return S}),n.d(t,"Q",function(){return Sr}),n.d(t,"R",function(){return he}),n.d(t,"S",function(){return pe}),n.d(t,"T",function(){return Tr}),n.d(t,"U",function(){return gr}),n.d(t,"V",function(){return mr}),n.d(t,"W",function(){return De}),n.d(t,"X",function(){return kn}),n.d(t,"Y",function(){return ct}),n.d(t,"Z",function(){return Ft}),n.d(t,"ab",function(){return Ut}),n.d(t,"bb",function(){return zt}),n.d(t,"cb",function(){return Vt}),n.d(t,"db",function(){return Bt}),n.d(t,"eb",function(){return Gt}),n.d(t,"fb",function(){return Ht}),n.d(t,"gb",function(){return Kt}),n.d(t,"hb",function(){return tt}),n.d(t,"ib",function(){return nt}),n.d(t,"jb",function(){return $t}),n.d(t,"kb",function(){return Wt}),n.d(t,"lb",function(){return Qt}),n.d(t,"mb",function(){return Y}),n.d(t,"nb",function(){return J}),n.d(t,"ob",function(){return bt}),n.d(t,"pb",function(){return rn}),n.d(t,"qb",function(){return oe}),n.d(t,"rb",function(){return yn}),n.d(t,"sb",function(){return wn}),n.d(t,"tb",function(){return C}),n.d(t,"ub",function(){return Ee}),n.d(t,"vb",function(){return we}),n.d(t,"wb",function(){return v}),n.d(t,"xb",function(){return Gr}),n.d(t,"yb",function(){return kr}),n.d(t,"zb",function(){return En}),n.d(t,"Ab",function(){return ur}),n.d(t,"Bb",function(){return cr}),n.d(t,"Cb",function(){return lr}),n.d(t,"Db",function(){return vr}),n.d(t,"Eb",function(){return wr}),n.d(t,"Fb",function(){return br}),n.d(t,"Gb",function(){return Fn}),n.d(t,"Hb",function(){return Ir}),n.d(t,"Ib",function(){return Hr}),n.d(t,"Jb",function(){return Yn}),n.d(t,"Kb",function(){return Wr}),n.d(t,"Lb",function(){return Jr}),n.d(t,"Mb",function(){return ri}),n.d(t,"Nb",function(){return l}),n.d(t,"Ob",function(){return on}),n.d(t,"Pb",function(){return Jn}),n.d(t,"Qb",function(){return Qn}),n.d(t,"Rb",function(){return sn}),n.d(t,"Sb",function(){return Zn}),n.d(t,"Tb",function(){return an}),n.d(t,"Ub",function(){return un}),n.d(t,"Vb",function(){return ln}),n.d(t,"Wb",function(){return cn}),n.d(t,"Xb",function(){return hn});var r=n(3),i=n(1),o=n(6),s=n(13),a=n(7);const u={PHONE:"phone",TOTP:"totp"},l={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},c={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},h={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},d={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};const f=function(){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 al
1ways 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 regist
vendor: 9,511 bytes, line 1
1ed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements."
1}},p=function(){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."}},m=new i.b("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."}),g={ADMIN_ONLY_OPERATION:"auth/admin-restricted-operation",ARGUMENT_ERROR:"auth/argument-error",APP_NOT_AUTHORIZED:"auth/app-not-authorized",APP_NOT_INSTALLED:"auth/app-not-installed",CAPTCHA_CHECK_FAILED:"auth/captcha-check-failed",CODE_EXPIRED:"auth/code-expired",CORDOVA_NOT_READY:"auth/cordova-not-ready",CORS_UNSUPPORTED:"auth/cors-unsupported",CREDENTIAL_ALREADY_IN_USE:"auth/credential-already-in-use",CREDENTIAL_MISMATCH:"auth/custom-token-mismatch",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"auth/requires-recent-login",DEPENDENT_SDK_INIT_BEFORE_AUTH:"auth/dependent-sdk-initialized-before-auth",DYNAMIC_LINK_NOT_ACTIVATED:"auth/dynamic-link-not-activated",EMAIL_CHANGE_NEEDS_VERIFICATION:"auth/email-change-needs-verification",EMAIL_EXISTS:"auth/email-already-in-use",EMULATOR_CONFIG_FAILED:"auth/emulator-config-failed",EXPIRED_OOB_CODE:"auth/expired-action-code",EXPIRED_POPUP_REQUEST:"auth/cancelled-popup-request",INTERNAL_ERROR:"auth/internal-error",INVALID_API_KEY:"auth/invalid-api-key",INVALID_APP_CREDENTIAL:"auth/invalid-app-credential",INVALID_APP_ID:"auth/invalid-app-id",INVALID_AUTH:"auth/invalid-user-token",INVALID_AUTH_EVENT:"auth/invalid-auth-event",INVALID_CERT_HASH:"auth/invalid-cert-hash",INVALID_CODE:"auth/invalid-verification-code",INVALID_CONTINUE_URI:"auth/invalid-continue-uri",INVALID_CORDOVA_CONFIGURATION:"auth/invalid-cordova-configuration",INVALID_CUSTOM_TOKEN:"auth/invalid-custom-token",INVALID_DYNAMIC_LINK_DOMAIN:"auth/invalid-dynamic-link-domain",INVALID_EMAIL:"auth/invalid-email",INVALID_EMULATOR_SCHEME:"auth/invalid-emulator-scheme",INVALID_IDP_RESPONSE:"auth/invalid-credential",INVALID_LOGIN_CREDENTIALS:"auth/invalid-credential",INVALID_MESSAGE_PAYLOAD:"auth/invalid-message-payload",INVALID_MFA_SESSION:"auth/invalid-multi-factor-session",INVALID_OAUTH_CLIENT_ID:"auth/invalid-oauth-client-id",INVALID_OAUTH_PROVIDER:"auth/invalid-oauth-provider",INVALID_OOB_CODE:"auth/invalid-action-code",INVALID_ORIGIN:"auth/unauthorized-domain",INVALID_PASSWORD:"auth/wrong-password",INVALID_PERSISTENCE:"auth/invalid-persistence-type",INVALID_PHONE_NUMBER:"auth/invalid-phone-number",INVALID_PROVIDER_ID:"auth/invalid-provider-id",INVALID_RECIPIENT_EMAIL:"auth/invalid-recipient-email",INVALID_SENDER:"auth/invalid-sender",INVALID_SESSION_INFO:"auth/invalid-verification-id",INVALID_TENANT_ID:"auth/invalid-tenant-id",MFA_INFO_NOT_FOUND:"auth/multi-factor-info-not-found",MFA_REQUIRED:"auth/multi-factor-auth-required",MISSING_ANDROID_PACKAGE_NAME:"auth/missing-android-pkg-name",MISSING_APP_CREDENTIAL:"auth/missing-app-credential",MISSING_AUTH_DOMAIN:"auth/auth-domain-config-required",MISSING_CODE:"auth/missing-verification-code",MISSING_CONTINUE_URI:"auth/missing-continue-uri",MISSING_IFRAME_START:"auth/missing-iframe-start",MISSING_IOS_BUNDLE_ID:"auth/missing-ios-bundle-id",MISSING_OR_INVALID_
1NONCE:"auth/missing-or-invalid-nonce",MISSING_MFA_INFO:"auth/missing-multi-factor-info",MISSING_MFA_SESSION:"auth/missing-multi-factor-session",MISSING_PHONE_NUMBER:"auth/missing-phone-number",MISSING_SESSION_INFO:"auth/missing-verification-id",MODULE_DESTROYED:"auth/app-deleted",NEED_CONFIRMATION:"auth/account-exists-with-different-credential",NETWORK_REQUEST_FAILED:"auth/network-request-failed",NULL_USER:"auth/null-user",NO_AUTH_EVENT:"auth/no-auth-event",NO_SUCH_PROVIDER:"auth/no-such-provider",OPERATION_NOT_ALLOWED:"auth/operation-not-allowed",OPERATION_NOT_SUPPORTED:"auth/operation-not-supported-in-this-environment",POPUP_BLOCKED:"auth/popup-blocked",POPUP_CLOSED_BY_USER:"auth/popup-closed-by-user",PROVIDER_ALREADY_LINKED:"auth/provider-already-linked",QUOTA_EXCEEDED:"auth/quota-exceeded",REDIRECT_CANCELLED_BY_USER:"auth/redirect-cancelled-by-user",REDIRECT_OPERATION_PENDING:"auth/redirect-operation-pending",REJECTED_CREDENTIAL:"auth/rejected-credential",SECOND_FACTOR_ALREADY_ENROLLED:"auth/second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"auth/maximum-second-factor-count-exceeded",TENANT_ID_MISMATCH:"auth/tenant-id-mismatch",TIMEOUT:"auth/timeout",TOKEN_EXPIRED:"auth/user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"auth/too-many-requests",UNAUTHORIZED_DOMAIN:"auth/unauthorized-continue-uri",UNSUPPORTED_FIRST_FACTOR:"auth/unsupported-first-factor",UNSUPPORTED_PERSISTENCE:"auth/unsupported-persistence-type",UNSUPPORTED_TENANT_OPERATION:"auth/unsupported-tenant-operation",UNVERIFIED_EMAIL:"auth/unverified-email",USER_CANCELLED:"auth/user-cancelled",USER_DELETED:"auth/user-not-found",USER_DISABLED:"auth/user-disabled",USER_MISMATCH:"auth/user-mismatch",USER_SIGNED_OUT:"auth/user-signed-out",WEAK_PASSWORD:"auth/weak-password",WEB_STORAGE_UNSUPPORTED:"auth/web-storage-unsupported",ALREADY_INITIALIZED:"auth/already-initialized",RECAPTCHA_NOT_ENABLED:"auth/recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"auth/missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"auth/invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"auth/invalid-recaptcha-action",MISSING_CLIENT_TYPE:"auth/missing-client-type",MISSING_RECAPTCHA_VERSION:"auth/missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"auth/invalid-recaptcha-version",INVALID_REQ_TYPE:"auth/invalid-req-type"},_=new o.b("@firebase/auth");function y(e,...t){_.logLevel<=o.a.ERROR&&_.error(`Auth (${r.SDK_VERSION}): ${e}`,...t)}function v(e,...t){throw E(e,...t)}function b(e,...t){return E(e,...t)}function w(e,t,n){const r=Object.assign(Object.assign({},p()),{[t]:n});return new i.b("auth","Firebase",r).create(t,{appName:e.name})}function I(e){return w(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function T(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&v(e,"argument-error"),w(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function E(e,...t){if("string"!=typeof e){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return m.create(e,...t)}function S(e,t,...n){if(!e)throw E(t,...n)}function A(e){const t="INTERNAL ASSERTION FAILED: "+e;throw y(t),new Error(t)}function C(e,t){e||A(t)}function k(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function x(){return"http:"===N()||"https:"===N()}function N(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}class D{constructor(e,t){this.shortDelay=e,this.longDelay=t,C(t>e,"Short delay should be less than long delay!"),this.isMobile=Object(i.w)()||Object(i.y)()}get(){return"undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(x()||Object(i.s)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function O(e,t){C(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class R{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void A("Could not find fetch implementation, make sure you call FetchProvi
1der.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void A("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void A("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const P={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},L=new D(3e4,6e4);function j(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function q(e,t,n,r,o={}){return M(e,o,async()=>{let o={},s={};r&&("GET"===t?s=r:o={body:JSON.stringify(r)});const a=Object(i.A)(Object.assign({key:e.config.apiKey},s)).slice(1),u=await e._getAdditionalHeaders();return u["Content-Type"]="application/json",e.languageCode&&(u["X-Firebase-Locale"]=e.languageCode),R.fetch()(U(e,e.config.apiHost,n,a),Object.assign({method:t,headers:u,referrerPolicy:"no-referrer"},o))})}async function M(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},P),t);try{const t=new V(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw B(e,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const t=i.ok?o.errorMessage:o.error.message,[n,s]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw B(e,"credential-already-in-use",o);if("EMAIL_EXISTS"===n)throw B(e,"email-already-in-use",o);if("USER_DISABLED"===n)throw B(e,"user-disabled",o);const a=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(s)throw w(e,a,s);v(e,a)}}catch(t){if(t instanceof i.c)throw t;v(e,"network-request-failed",{message:String(t)})}}async function F(e,t,n,r,i={}){const o=await q(e,t,n,r,i);return"mfaPendingCredential"in o&&v(e,"multi-factor-auth-required",{_serverResponse:o}),o}function U(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?O(e.config,i):`${e.config.apiScheme}://${i}`}function z(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class V{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>
1{this.timer=setTimeout(()=>t(b(this.auth,"network-request-failed")),L.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function B(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=b(e,t,r);return i.customData._tokenResponse=n,i}function G(e){return void 0!==e&&void 0!==e.getResponse}function H(e){return void 0!==e&&void 0!==e.enterprise}class K{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return z(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}}async function $(e,t){return q(e,"GET","/v2/recaptchaConfig",j(e,t))}async function W(e,t){return q(e,"POST","/v1/accounts:lookup",t)}function Q(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function Y(e,t=!1){return Object(i.p)(e).getIdToken(t)}async function J(e,t=!1){const n=Object(i.p)(e),r=await n.getIdToken(t),o=Z(r);S(o&&o.exp&&o.auth_time&&o.iat,n.auth,"internal-error");const s="object"==typeof o.firebase?o.firebase:void 0,a=null==s?void 0:s.sign_in_provider;return{claims:o,token:r,authTime:Q(X(o.auth_time)),issuedAtTime:Q(X(o.iat)),expirationTime:Q(X(o.exp)),signInProvider:a||null,signInSecondFactor:(null==s?void 0:s.sign_in_second_factor)||null}}function X(e){return 1e3*Number(e)}function Z(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return y("JWT malformed, contained fewer than 3 sections"),null;try{const e=Object(i.d)(n);return e?JSON.parse(e):(y("Failed to decode base64 JWT payload"),null)}catch(e){return y("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}function ee(e){const t=Z(e);return S(t,"internal-error"),S(void 0!==t.exp,"internal-error"),S(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function te(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof i.c&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class ne{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 e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===(null==e?void 0:e.code)&&this.schedule(!0))}this.schedule()}}class re{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Q(this.lastLoginAt),this.creationTime=Q(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function ie(e){var t;const n=e.auth,r=await e.getIdToken(),i=await te(e,W(n,{idToken:r}));S(null==i?void 0:i.users.length,n,"internal-error");const o=i.users[0];e._notifyReloadListener(o);const s=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?se(o.providerUserInfo):[],a=(u=e.providerData,l=s,[...u.filter(e=>!l.some(t=>t.providerId===e.providerId)),...l]);var u,l;const c=e.isAnonymous,h=!(e.email&&o.passwordHash||(null==a?void 0:a.length)),d=!!c&&h,f={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:a,metadata:new re(o.createdAt,o.lastLoginAt),isAnonymous:d};Object.assign(e,f)}async function oe(e){const t=Object(i.p)(e);await ie(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function se(e){return e.map(e=>{var{providerId:t}=e,n=Object(s.a)(e,["providerId"]);
1return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}class ae{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){S(e.idToken,"internal-error"),S(void 0!==e.idToken,"internal-error"),S(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):ee(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){S(0!==e.length,"internal-error");const t=ee(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(S(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:o}=await async function(e,t){const n=await M(e,{},async()=>{const n=Object(i.A)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:o}=e.config,s=U(e,r,"/v1/token","key="+o),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",R.fetch()(s,{method:"POST",headers:a,body:n})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(o))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,o=new ae;return n&&(S("string"==typeof n,"internal-error",{appName:e}),o.refreshToken=n),r&&(S("string"==typeof r,"internal-error",{appName:e}),o.accessToken=r),i&&(S("number"==typeof i,"internal-error",{appName:e}),o.expirationTime=i),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 ae,this.toJSON())}_performRefresh(){return A("not implemented")}}function ue(e,t){S("string"==typeof e||void 0===e,"internal-error",{appName:t})}class le{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=Object(s.a)(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ne(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new re(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await te(this,this.stsTokenManager.getToken(this.auth,e));return S(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return J(this,e)}reload(){return oe(this)}_assign(e){this!==e&&(S(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new le(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){S(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await ie(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Object(r._isFirebaseServerApp)(this.auth.app))return Promise.reject(I(this.auth));const e=await this.getIdToken();return await te(this,async function(e,t){return q(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
vendor: 10,475 bytes, line 1
1nonymous: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 n,r,i,o,s,a,u,l;const c=null!==(n=t.displayName)&&void 0!==n?n:void 0,h=null!==(r=t.email)&&void 0!==r?r:void 0,d=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,f=null!==(o=t.photoURL)&&void 0!==o?o:void 0,p=null!==(s=t.tenantId)&&void 0!==s?s:void 0,m=null!==(a=t._redirectEventId)&&void 0!==a?a:void 0,g=null!==(u=t.createdAt)&&void 0!==u?u:void 0,_=null!==(l=t.lastLoginAt)&&void 0!==l?l:void 0,{uid:y,emailVerified:v,isAnonymous:b,providerData:w,stsTokenManager:I}=t;S(y&&I,e,"internal-error");const T=ae.fromJSON(this.name,I);S("string"==typeof y,e,"internal-error"),ue(c,e.name),ue(h,e.name),S("boolean"==typeof v,e,"internal-error"),S("boolean"==typeof b,e,"internal-error"),ue(d,e.name),ue(f,e.name),ue(p,e.name),ue(m,e.name),ue(g,e.name),ue(_,e.name);const E=new le({uid:y,auth:e,email:h,emailVerified:v,displayName:c,isAnonymous:b,photoURL:f,phoneNumber:d,tenantId:p,stsTokenManager:T,createdAt:g,lastLoginAt:_});return w&&Array.isArray(w)&&(E.providerData=w.map(e=>Object.assign({},e))),m&&(E._redirectEventId=m),E}static async _fromIdTokenResponse(e,t,n=!1){const r=new ae;r.updateFromServerResponse(t);const i=new le({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await ie(i),i}static async _fromGetAccountInfoResponse(e,t,n){const r=t.users[0];S(void 0!==r.localId,"internal-error");const i=void 0!==r.providerUserInfo?se(r.providerUserInfo):[],o=!(r.email&&r.passwordHash||(null==i?void 0:i.length)),s=new ae;s.updateFromIdToken(n);const a=new le({uid:r.localId,auth:e,stsTokenManager:s,isAnonymous:o}),u={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:i,metadata:new re(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash||(null==i?void 0:i.length))};return Object.assign(a,u),a}}const ce=new Map;function he(e){C(e instanceof Function,"Expected a class definition");let t=ce.get(e);return t?(C(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,ce.set(e,t),t)}class de{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}de.type="NONE";const fe=de;function pe(e,t,n){return`firebase:${e}:${t}:${n}`}class me{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=pe(this.userKey,r.apiKey,i),this.fullPersistenceKey=pe("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?le._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new me(he(fe),e,n);const r=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let i=r[0]||he(fe);const o=pe(n,e.config.apiKey,e.name);let s=null;for(const n of t)try{const t=await n._get(o);if(t){const r=le._fromJSON(e,t);n!==i&&(s=r),i=n;break}}catch(e){}const a=r.filter(e=>e._shouldAllowMigration);return i._shouldAllowMigration&&a.length?(i=a[0],s&&await i._set(o,s.toJSON()),await Promise.all(t.map(async e=>{if(e!==i)try{await e._remove(o)}catch(e){}})),new me(i,e,n)):new me(i,e,n)}}function ge(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(be(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(_e(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Ie(t))return"Blackberry";if(Te(t))return"Webos";if(ye(t))return"Safari";if((t.includes("chrome/")||ve(t))&&!t.includes("edge/"))return"Chrome";if(we(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function _e(e=Object(i.q)()){return/firefox\//i.test(e)}function ye(e=Object(i.q)()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function ve(e=Object(i.q)()){return/crios\//i.test(e)}function be(e=Object(i.q)()){return/iemobile/i.test(e)}function we(e=Object(i.q)()){return/android/i.test(e)}function Ie(e=Object(i.q)()){return/blackberry/i.test(e)}function Te(e=Object(i.q)()){return/webos/i.test(e)}function Ee(e=Object(i.q)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Se(e=Object(i.q)()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(e)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(e)}function Ae(e=Object(i.q)()){return Ee(e)||we(e)||Te(e)||Ie(e)||/windows phone/i.test(e)||be(e)}function Ce(e,t=[]){let n;switch(e){case"Browser":n=ge(Object(i.q)());break;case"Worker":n=`${ge(Object(i.q)())}-${e}`;break;default:n=e}const o=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${r.SDK_VERSION}/${o}`}class ke{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,r)=>{try{n(e(t))}catch(e){r(e)}});n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const n of t)try{n()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}class xe{constructor(e){var t,n,r,i;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=o.minPasswordLength)&&void 0!==t?t:6,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),void 0!==o.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),void 0!==o.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),void 0!==o.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),void 0!==o.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(r=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==r?r:"",this.forceUpgradeOnSignin=null!==(i=e.forceUpgradeOnSignin)&&void 0!==i&&i,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,r,i,o,s;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,a),this.validatePasswordCharacterOptions(e,a),a.isValid&&(a.isValid=null===(t=a.meetsMinPasswordLength)||void 0===t||t),a.isValid&&(a.isValid=null===(n=a.meetsMaxPasswordLength)||void 0===n||n),a.isValid&&(a.isValid=null===(r=a.containsLowercaseLetter)||void 0===r||r),a.isValid&&(a.isValid=null===(i=a.containsUppercaseLetter)||void 0===i||i),a.isValid&&(a.isValid=null===(o=a.containsNumericCharacter)||void 0===o||o),a.isValid&&(a.isValid=null===(s=a.containsNonAlphanumericCharacter)||void 0===s||s),a}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r<e.length;r++)n=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,r,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class Ne{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Oe(this),this.idTokenSubscription=new Oe(this),this.beforeStateQueue=new ke(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=m,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=he(t)),this._initializationPromise=this.queue(async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await me.create(this,e),!this._deleted)){if
1(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await W(this,{idToken:e}),n=await le._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(Object(r._isFirebaseServerApp)(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let i=n,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,r=null==i?void 0:i._redirectEventId,s=await this.tryRedirectSignIn(e);n&&n!==r||!(null==s?void 0:s.user)||(i=s.user,o=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(i)}catch(e){i=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return S(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await ie(e)}catch(e){if("auth/network-request-failed"!==(null==e?void 0:e.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Object(r._isFirebaseServerApp)(this.app))return Promise.reject(I(this));const t=e?Object(i.p)(e):null;return t&&S(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&S(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Object(r._isFirebaseServerApp)(this.app)?Promise.reject(I(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Object(r._isFirebaseServerApp)(this.app)?Promise.reject(I(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(he(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return q(e,"GET","/v2/passwordPolicy",j(e,t))}(this),t=new xe(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new i.b("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>
1{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return q(e,"POST","/v2/accounts:revokeToken",j(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&he(e)||this._popupRedirectResolver;S(t,this,"argument-error"),this.redirectPersistenceManager=await me.create(this,[he(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const i="function"==typeof t?t:t.next.bind(t);let o=!1;const s=this._isInitialized?Promise.resolve():this._initializationPromise;if(S(s,this,"internal-error"),s.then(()=>{o||i(this.currentUser)}),"function"==typeof t){const i=e.addObserver(t,n,r);return()=>{o=!0,i()}}{const n=e.addObserver(t);return()=>{o=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return S(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Ce(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){_.logLevel<=o.a.WARN&&_.warn(`Auth (${r.SDK_VERSION}): ${e}`,...t)}("Error while retrieving App Check token: "+t.error),null==t?void 0:t.token}}function De(e){return Object(i.p)(e)}class Oe{constructor(e){this.auth=e,this.observer=null,this.addObserver=Object(i.h)(e=>this.observer=e)}get next(){return S(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let Re={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Pe(e){return Re.loadJS(e)}function Le(e){return`__${e}${Math.floor(1e6*Math.random())}`}class je{constructor(e){this.type="recaptcha-enterprise",this.auth=De(e)}async verify(e="verify",t=!1){function n(t,n,r){const i=window.grecaptcha;H(i)?i.enterprise.ready(()=>{i.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n("NO_RECAPTCHA")})}):r(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>
1{$(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(r=>{if(void 0!==r.recaptchaKey){const n=new K(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})})(this.auth).then(i=>{if(!t&&H(window.grecaptcha))n(i,e,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=Re.recaptchaEnterpriseScript;0!==t.length&&(t+=i),Pe(t).then(()=>{n(i,e,r)}).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function qe(e,t,n,r=!1){const i=new je(e);let o;try{o=await i.verify(n)}catch(e){o=await i.verify(n,!0)}const s=Object.assign({},t);return r?Object.assign(s,{captchaResp:o}):Object.assign(s,{captchaResponse:o}),Object.assign(s,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(s,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),s}async function Me(e,t,n,r){var i;if(null===(i=e._getRecaptchaConfig())||void 0===i?void 0:i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await qe(e,t,n,"getOobCode"===n);return r(e,i)}return r(e,t).catch(async i=>{if("auth/missing-recaptcha-token"===i.code){console.log(n+" is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.");const i=await qe(e,t,n,"getOobCode"===n);return r(e,i)}return Promise.reject(i)})}function Fe(e,t){const n=Object(r._getProvider)(e,"auth");if(n.isInitialized()){const e=n.getImmediate(),r=n.getOptions();if(Object(i.i)(r,null!=t?t:{}))return e;v(e,"already-initialized")}return n.initialize({options:t})}function Ue(e,t,n){const r=De(e);S(r._canInitEmulator,r,"emulator-config-failed"),S(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(null==n?void 0:n.disableWarnings),o=ze(t),{host:s,port:a}=function(e){const t=ze(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:Ve(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:Ve(t)}}}(t),u=null===a?"":":"+a;r.config.emulator={url:`${o}//${s}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:s,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){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)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function ze(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Ve(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Be{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return A("not implemented")}_getIdTokenResponse(e){return A("not implemented")}_linkToIdToken(e,t){return A("not implemented")}_getReauthenticationResolver(e){return A("not implemented")}}async function Ge(e,t){return q(e,"POST","/v1/accounts:resetPassword",j(e,t))}async function He(e,t){return q(e,"POST","/v1/accounts:signUp",t)}async function Ke(e,t){return F(e,"POST","/v1/accounts:signInWithPassword",j(e,t))}async function $e(e,t){return q(e,"POST","/v1/accounts:sendOobCode",j(e,t))}async function We(e,t){return $e(e,t)}async function Qe(e,t){return $e(e,t)}class Ye extends Be{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new Ye(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new Ye(e,t,"emailLink",n)}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?void 0:t.email)&&(null==t?void 0: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}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Me(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",Ke);case"emailLink":return async function(e,t){return F(e,"POST","/v1/accounts:signInWithEmailLink",j(e,t))}(e,{email:this._email,oobCode:this._password});default:v(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Me(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",He);case"emailLink":return async function(e,t){return F(e,"POST","/v1/accounts:signInWithEmailLink",j(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:v(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Je(e,t){return F(e,"POST","/v1/accounts:signInWithIdp",j(e,t))}class Xe extends Be{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Xe(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&&
1(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):v("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:n,signInMethod:r}=t,i=Object(s.a)(t,["providerId","signInMethod"]);if(!n||!r)return null;const o=new Xe(n,r);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(e){return Je(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Je(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Je(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=Object(i.A)(t)}return e}}const Ze={USER_NOT_FOUND:"user-not-found"};class et extends Be{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new et({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new et({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return F(e,"POST","/v1/accounts:signInWithPhoneNumber",j(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await F(e,"POST","/v1/accounts:signInWithPhoneNumber",j(e,t));if(n.temporaryProof)throw B(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return F(e,"POST","/v1/accounts:signInWithPhoneNumber",j(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),Ze)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}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:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new et({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class tt{constructor(e){var t,n,r,o,s,a;const u=Object(i.B)(Object(i.k)(e)),l=null!==(t=u.apiKey)&&void 0!==t?t:null,c=null!==(n=u.oobCode)&&void 0!==n?n:null,h=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=u.mode)&&void 0!==r?r:null);S(l&&c&&h,"argument-error"),this.apiKey=l,this.operation=h,this.code=c,this.continueUrl=null!==(o=u.continueUrl)&&void 0!==o?o:null,this.languageCode=null!==(s=u.languageCode)&&void 0!==s?s:null,this.tenantId=null!==(a=u.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=Object(i.B)(Object(i.k)(e)).link,n=t?Object(i.B)(Object(i.k)(t)).deep_link_id:null,r=Object(i.B)(Object(i.k)(e)).deep_link_id;return(r?Object(i.B)(Object(i.k)(r)).link:null)||r||n||t||e}(e);try{return new tt(t)}catch(e){return null}}}function nt(e){return tt.parseLink(e)}class rt{constructor(){this.providerId=rt.PROVIDER_ID}static credential(e,t){return Ye._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=tt.parseLink(t);return S(n,"argument-error"),Ye._fromEmailAndCode(e,n.code,n.tenantId)}}rt.PROVIDER_ID="password",rt.EMAIL_PASSWORD_SIGN_IN_METHOD="password",rt.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class it{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 ot extends it{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class st extends ot{static credentialFromJSON(e){const t="string"==typeof e?JSON.parse(e):e;return S("providerId"in t&&"signInMethod"in t,"argument-error"),Xe._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return S(e.idToken||e.accessToken,"argument-error"),Xe._fromParams(Object.assign(Object.assign({}
vendor: 4,694 bytes, line 1
1,e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return st.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return st.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n,oauthTokenSecret:r,pendingToken:i,nonce:o,providerId:s}=e;if(!(n||r||t||i))return null;if(!s)return null;try{return new st(s)._credential({idToken:t,accessToken:n,nonce:o,pendingToken:i})}catch(e){return null}}}class at extends ot{constructor(){super("facebook.com")}static credential(e){return Xe._fromParams({providerId:at.PROVIDER_ID,signInMethod:at.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return at.credentialFromTaggedObject(e)}static credentialFromError(e){return at.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return at.credential(e.oauthAccessToken)}catch(e){return null}}}at.FACEBOOK_SIGN_IN_METHOD="facebook.com",at.PROVIDER_ID="facebook.com";class ut extends ot{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Xe._fromParams({providerId:ut.PROVIDER_ID,signInMethod:ut.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return ut.credentialFromTaggedObject(e)}static credentialFromError(e){return ut.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return ut.credential(t,n)}catch(e){return null}}}ut.GOOGLE_SIGN_IN_METHOD="google.com",ut.PROVIDER_ID="google.com";class lt extends ot{constructor(){super("github.com")}static credential(e){return Xe._fromParams({providerId:lt.PROVIDER_ID,signInMethod:lt.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return lt.credentialFromTaggedObject(e)}static credentialFromError(e){return lt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return lt.credential(e.oauthAccessToken)}catch(e){return null}}}lt.GITHUB_SIGN_IN_METHOD="github.com",lt.PROVIDER_ID="github.com";class ct extends Be{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return Je(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Je(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Je(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:n,signInMethod:r,pendingToken:i}=t;return n&&r&&i&&n===r?new ct(n,i):null}static _create(e,t){return new ct(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class ht extends it{constructor(e){S(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return ht.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return ht.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){const t=ct.fromJSON(e);return S(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{pendingToken:t,providerId:n}=e;if(!t||!n)return null;try{return ct._create(n,t)}catch(e){return null}}}class dt extends ot{constructor(){super("twitter.com")}static credential(e,t){return Xe._fromParams({providerId:dt.PROVIDER_ID,signInMethod:dt.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return dt.credentialFromTaggedObject(e)}static credentialFromError(e){return dt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return dt.credential(t,n)}catch(e){return null}}}async function ft(e,t){return F(e,"POST","/v1/accounts:signUp",j(e,t))}dt.TWITTER_SIGN_IN_METHOD="twitter.com",dt.PROVIDER_ID="twitter.com";class pt{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,r=!1){const i=await le._fromIdTokenResponse(e,n,r),o=mt(n);return new pt({user:i,providerId:o,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=mt(n);
1return new pt({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function mt(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}async function gt(e){var t;if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(I(e));const n=De(e);if(await n._initializationPromise,null===(t=n.currentUser)||void 0===t?void 0:t.isAnonymous)return new pt({user:n.currentUser,providerId:null,operationType:"signIn"});const i=await ft(n,{returnSecureToken:!0}),o=await pt._fromIdTokenResponse(n,"signIn",i,!0);return await n._updateCurrentUser(o.user),o}class _t extends i.c{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,_t.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new _t(e,t,n,r)}}function yt(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw _t._fromErrorAndOperation(e,n,t,r);throw n})}function vt(e){return new Set(e.map(({providerId:e})=>e).filter(e=>!!e))}async function bt(e,t){const n=Object(i.p)(e);await It(!0,n,t);const{providerUserInfo:r}=await async function(e,t){return q(e,"POST","/v1/accounts:update",t)}(n.auth,{idToken:await n.getIdToken(),deleteProvider:[t]}),o=vt(r||[]);return n.providerData=n.providerData.filter(e=>o.has(e.providerId)),o.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}async function wt(e,t,n=!1){const r=await te(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return pt._forOperation(e,"link",r)}async function It(e,t,n){await ie(t);const r=!1===e?"provider-already-linked":"no-such-provider";S(vt(t.providerData).has(n)===e,t.auth,r)}async function Tt(e,t,n=!1){const{auth:i}=e;if(Object(r._isFirebaseServerApp)(i.app))return Promise.reject(I(i));try{const r=await te(e,yt(i,"reauthenticate",t,e),n);S(r.idToken,i,"internal-error");const o=Z(r.idToken);S(o,i,"internal-error");const{sub:s}=o;return S(e.uid===s,i,"user-mismatch"),pt._forOperation(e,"reauthenticate",r)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&v(i,"user-mismatch"),e}}async function Et(e,t,n=!1){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(I(e));const i=await yt(e,"signIn",t),o=await pt._fromIdTokenResponse(e,"signIn",i);return n||await e._updateCurrentUser(o.user),o}async function St(e,t){return Et(De(e),t)}async function At(e,t){const n=Object(i.p)(e);return await It(!1,n,t.providerId),wt(n,t)}async function Ct(e,t){return Tt(Object(i.p)(e),t)}async function kt(e,t){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(I(e));const n=De(e),i=await async function(e,t){return F(e,"POST","/v1/accounts:signInWithCustomToken",j(e,t))}(n,{token:t,returnSecureToken:!0}),o=await pt._fromIdTokenResponse(n,"signIn",i);return await n._updateCurrentUser(o.user),o}class xt{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?Nt._fromServerResponse(e,t):"totpInfo"in t?Dt._fromServerResponse(e,t):v(e,"internal-error")}}class Nt extends xt{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new Nt(t)}}class Dt extends xt{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new Dt(t)}}function Ot(e,t,n){var r;S((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"invalid-continue-uri"),S(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(S(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(S(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function Rt(e){const t=De(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function Pt(e,t,n){const r=De(e),i={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};
1n&&Ot(r,i,n),await Me(r,i,"getOobCode",We)}async function Lt(e,t,n){await Ge(Object(i.p)(e),{oobCode:t,newPassword:n}).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Rt(e),t})}async function jt(e,t){await async function(e,t){return q(e,"POST","/v1/accounts:update",j(e,t))}(Object(i.p)(e),{oobCode:t})}async function qt(e,t){const n=Object(i.p)(e),r=await Ge(n,{oobCode:t}),o=r.requestType;switch(S(o,n,"internal-error"),o){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":S(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":S(r.mfaInfo,n,"internal-error");default:S(r.email,n,"internal-error")}let s=null;return r.mfaInfo&&(s=xt._fromServerResponse(De(n),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:o}}async function Mt(e,t){const{data:n}=await qt(Object(i.p)(e),t);return n.email}async function Ft(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(I(e));const i=De(e),o=Me(i,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",ft),s=await o.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Rt(e),t}),a=await pt._fromIdTokenResponse(i,"signIn",s);return await i._updateCurrentUser(a.user),a}function Ut(e,t,n){return Object(r._isFirebaseServerApp)(e.app)?Promise.reject(I(e)):St(Object(i.p)(e),rt.credential(t,n)).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Rt(e),t})}async function zt(e,t,n){const r=De(e),i={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};!function(e,t){S(t.handleCodeInApp,r,"argument-error"),t&&Ot(r,e,t)}(i,n),await Me(r,i,"getOobCode",Qe)}function Vt(e,t){const n=tt.parseLink(t);return"EMAIL_SIGNIN"===(null==n?void 0:n.operation)}async function Bt(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(I(e));const o=Object(i.p)(e),s=rt.credentialWithLink(t,n||k());return S(s._tenantId===(o.tenantId||null),o,"tenant-id-mismatch"),St(o,s)}async function Gt(e,t){const n={identifier:t,continueUri:x()?k():"http://localhost"},{signinMethods:r}=await async function(e,t){return q(e,"POST","/v1/accounts:createAuthUri",j(e,t))}(Object(i.p)(e),n);return r||[]}async function Ht(e,t){const n=Object(i.p)(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&Ot(n.auth,r,t);const{email:o}=await async function(e,t){return $e(e,t)}(n.auth,r);o!==e.email&&await e.reload()}async function Kt(e,t,n){const r=Object(i.p)(e),o={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};n&&Ot(r.auth,o,n);const{email:s}=await async function(e,t){return $e(e,t)}(r.auth,o);s!==e.email&&await e.reload()}async function $t(e,{displayName:t,photoURL:n}){if(void 0===t&&void 0===n)return;const r=Object(i.p)(e),o={idToken:await r.getIdToken(),displayName:t,photoUrl:n,returnSecureToken:!0},s=await te(r,async function(e,t){return q(e,"POST","/v1/accounts:update",t)}(r.auth,o));r.displayName=s.displayName||null,r.photoURL=s.photoUrl||null;const a=r.providerData.find(({providerId:e})=>"password"===e);a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(s)}function Wt(e,t){const n=Object(i.p)(e);return Object(r._isFirebaseServerApp)(n.auth.app)?Promise.reject(I(n.auth)):Yt(n,t,null)}function Qt(e,t){return Yt(Object(i.p)(e),null,t)}async function Yt(e,t,n){const{auth:r}=e,i={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(i.email=t),n&&(i.password=n);const o=await te(e,async function(e,t){return q(e,"POST","/v1/accounts:update",t)}(r,i));await e._updateTokensIfNecessary(o,!0)}class Jt{constructor(e,t,n={}){this.isNewUser=e,this.providerId=t,this.profile=n}}class Xt extends Jt{constructor(e,t,n,r){super(e,t,n),this.username=r}}class Zt extends Jt{constructor(e,t){super(e,"facebook.com",t)}}class en extends Xt{constructor(e,t){super(e,"github.com",t,"string"==typeof(null==t?void 0:t.login)?null==t?void 0:t.login:null)}}class tn extends Jt{constructor(e,t){super(e,"google.com",t)}}class nn extends Xt{constructor(e,t,n){super(e,"twitter.com",t,n)}}
1function rn(e){const{user:t,_tokenResponse:n}=e;return t.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:function(e){var t,n;if(!e)return null;const{providerId:r}=e,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},o=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!r&&(null==e?void 0:e.idToken)){const r=null===(n=null===(t=Z(e.idToken))||void 0===t?void 0:t.firebase)||void 0===n?void 0:n.sign_in_provider;if(r)return new Jt(o,"anonymous"!==r&&"custom"!==r?r:null)}if(!r)return null;switch(r){case"facebook.com":return new Zt(o,i);case"github.com":return new en(o,i);case"google.com":return new tn(o,i);case"twitter.com":return new nn(o,i,e.screenName||null);case"custom":case"anonymous":return new Jt(o,null);default:return new Jt(o,r,i)}}(n)}function on(e,t){return Object(i.p)(e).setPersistence(t)}function sn(e){return async function(e){const t=De(e),n=await $(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new K(n);null==t.tenantId?t._agentRecaptchaConfig=r:t._tenantRecaptchaConfigs[t.tenantId]=r,r.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")&&new je(t).verify()}(e)}async function an(e,t){return De(e).validatePassword(t)}function un(e,t,n,r){return Object(i.p)(e).onIdTokenChanged(t,n,r)}
1function ln(e,t,n){return Object(i.p)(e).beforeAuthStateChanged(t,n)}function cn(e,t,n,r){return Object(i.p)(e).onAuthStateChanged(t,n,r)}function hn(e){Object(i.p)(e).useDeviceLanguage()}function dn(e,t){return Object(i.p)(e).updateCurrentUser(t)}function fn(e){return Object(i.p)(e).signOut()}function pn(e,t){return De(e).revokeAccessToken(t)}async function mn(e){return Object(i.p)(e).delete()}class gn{constructor(e,t,n){this.type=e,this.credential=t,this.user=n}static _fromIdtoken(e,t){return new gn("enroll",e,t)}static _fromMfaPendingCredential(e){return new gn("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,n;if(null==e?void 0:e.multiFactorSession){if(null===(t=e.multiFactorSession)||void 0===t?void 0:t.pendingCredential)return gn._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(null===(n=e.multiFactorSession)||void 0===n?void 0:n.idToken)return gn._fromIdtoken(e.multiFactorSession.idToken)}return null}}class _n{constructor(e,t,n){this.session=e,this.hints=t,this.signInResolver=n}static _fromError(e,t){const n=De(e),r=t.customData._serverResponse,i=(r.mfaInfo||[]).map(e=>xt._fromServerResponse(n,e));S(r.mfaPendingCredential,n,"internal-error");const o=gn._fromMfaPendingCredential(r.mfaPendingCredential);return new _n(o,i,async e=>{const i=await e._process(n,o);delete r.mfaInfo,delete r.mfaPendingCredential;const s=Object.assign(Object.assign({},r),{idToken:i.idToken,refreshToken:i.refreshToken});switch(t.operationType){case"signIn":const e=await pt._fromIdTokenResponse(n,t.operationType,s);return await n._updateCurrentUser(e.user),e;case"reauthenticate":return S(t.user,n,"internal-error"),pt._forOperation(t.user,t.operationType,s);default:v(n,"internal-error")}})}async resolveSignIn(e){const t=e;return this.signInResolver(t)}}function yn(e,t){var n;const r=Object(i.p)(e),o=t;return S(t.customData.operationType,r,"argument-error"),S(null===(n=o.customData._serverResponse)||void 0===n?void 0:n.mfaPendingCredential,r,"argument-error"),_n._fromError(r,o)}class vn{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(t=>xt._fromServerResponse(e.auth,t)))})}static _fromUser(e){return new vn(e)}async getSession(){return gn._fromIdtoken(await this.user.getIdToken(),this.user)}
1async enroll(e,t){const n=e,r=await this.getSession(),i=await te(this.user,n._process(this.user.auth,r,t));return await this.user._updateTokensIfNecessary(i),this.user.reload()}async unenroll(e){const t="string"==typeof e?e:e.uid,n=await this.user.getIdToken();try{const e=await te(this.user,(r=this.user.auth,i={idToken:n,mfaEnrollmentId:t},q(r,"POST","/v2/accounts/mfaEnrollment:withdraw",j(r,i))));this.enrolledFactors=this.enrolledFactors.filter(({uid:e})=>e!==t),await this.user._updateTokensIfNecessary(e),await this.user.reload()}catch(e){throw e}var r,i}}const bn=new WeakMap;function wn(e){const t=Object(i.p)(e);return bn.has(t)||bn.set(t,vn._fromUser(t)),bn.get(t)}class In{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem("__sak","1"),this.storage.removeItem("__sak"),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){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()}}class Tn extends In{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const e=Object(i.q)();return ye(e)||Ee(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=Ae(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const r=this.storage.getItem(n);if(e.newValue!==r)null!==e.newValue?this.storage.setItem(n,e.newValue):this.storage.removeItem(n);else if(this.localCache[n]===e.newValue&&!t)return}const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},o=this.storage.getItem(n);Object(i.u)()&&10===document.documentMode&&o!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Tn.type="LOCAL";const En=Tn;class Sn extends In{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Sn.type="SESSION";const An=Sn;class Cn{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new Cn(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,o=this.handlersMap[r];if(!(null==o?void 0:o.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const s=Array.from(o).map(async e=>e(t.origin,i)),a=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}}))}(s);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function kn(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}Cn.receivers=[];class xn{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const r="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,o;return new Promise((s,a)=>{const u=kn("",20);r.port1.start();const l=setTimeout(()=>{a(new Error("unsupported_event"))},n);o={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===u)switch(t.data.status){case"ack":clearTimeout(l),i=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),s(t.data.response);break;default:clearTimeout(l),clearTimeout(i),a(new Error("invalid_response"))}}},this.handlers.add(o),r.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:u,data:t},[r.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}function Nn(){return window}
1function Dn(){return void 0!==Nn().WorkerGlobalScope&&"function"==typeof Nn().importScripts}const On="firebaseLocalStorageDb";class Rn{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 Pn(e,t){return e.transaction(["firebaseLocalStorage"],t?"readwrite":"readonly").objectStore("firebaseLocalStorage")}function Ln(){const e=indexedDB.open(On,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains("firebaseLocalStorage")?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(On);return new Rn(e).toPromise()}(),t(await Ln()))})})}async function jn(e,t,n){const r=Pn(e,!0).put({fbase_key:t,value:n});return new Rn(r).toPromise()}function qn(e,t){const n=Pn(e,!0).delete(t);return new Rn(n).toPromise()}class Mn{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await Ln()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Dn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Cn._getInstance(Dn()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new xn(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Ln();return await jn(e,"__sak","1"),await qn(e,"__sak"),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>jn(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=Pn(e,!1).get(t),r=await new Rn(n).toPromise();return void 0===r?null:r.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>qn(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(e=>{const t=Pn(e,!1).getAll();return new Rn(t).toPromise()});if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}Mn.type="LOCAL";const Fn=Mn;class Un{constructor(e){this.auth=e,this.counter=1e12,this._widgets=new Map}render(e,t){const n=this.counter;return this._widgets.set(n,new zn(e,this.auth.name,t||{})),this.counter++,n}reset(e){var t;const n=e||1e12;null===(t=this._widgets.get(n))||void 0===t||t.delete(),this._widgets.delete(n)}getResponse(e){var t;const n=e||1e12;return(null===(t=this._widgets.get(n))||void 0===t?void 0:t.getResponse())||""}async execute(e){var t;const n=e||1e12;return null===(t=this._widgets.get(n))||void 0===t||t.execute(),""}}class zn{constructor(e,t,n){this.params=n,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const r="string"==typeof e?document.getElementById(e):e;S(r,"argument-error",{appName:t}),this.container=r,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(){const e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let n=0;n<50;n++)e.push(t.charAt(Math.floor(62*Math.random())));return e.join("")}();const{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()},6e4)},500))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}const Vn=Le("rcb"),Bn=new D(3e4,6e4);class Gn{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(null===(e=Nn().grecaptcha)||void 0===e?void 0:e.render)}load(e,t=""){return S(function(e){return e.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(e)}(t),e,"argument-error"),this.shouldResolveImmediately(t)&&G(Nn().grecaptcha)?Promise.resolve(Nn().grecaptcha):new Promise((n,r)=>{const o=Nn().setTimeout(()=>{r(b(e,"network-request-failed"))},Bn.get());Nn()[Vn]=()=>{Nn().clearTimeout(o),delete Nn()[Vn];const i=Nn().grecaptcha;if(!i||!G(i))return void r(b(e,"internal-error"));const s=i.render;i.render=(e,t)=>{const n=s(e,t);return this.counter++,n},this.hostLanguage=t,n(i)},Pe(`${Re.recaptchaV2Script}?${Object(i.A)({onload:Vn,render:"explicit",hl:t})}`).catch(()=>{clearTimeout(o),r(b(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!!(null===(t=Nn().grecaptcha)||void 0===t?void 0:t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class Hn{async load(e){return new Un(e)}clearedOneInstance(){}}const Kn={theme:"light",type:"image"};class $n{constructor(e,t,n=Object.assign({},Kn)){this.parameters=n,this.type="recaptcha",this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=De(e),this.isInvisible="invisible"===this.parameters.size,S("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment");const r="string"==typeof t?document.getElementById(t):t;S(r,this.auth,"argument-error"),this.container=r,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Hn:new Gn,this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),t=this.getAssertedRecaptcha();return t.getResponse(e)||new Promise(n=>{const r=e=>{e&&(this.tokenChangeListeners.delete(r),n(e))};this.tokenChangeListeners.add(r),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e})),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEac
1h(e=>{this.container.removeChild(e)})}validateStartingState(){S(!this.parameters.sitekey,this.auth,"argument-error"),S(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),S("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(e=>e(t)),"function"==typeof e)e(t);else if("string"==typeof e){const n=Nn()[e];"function"==typeof n&&n(t)}}}assertNotDestroyed(){S(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){const t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){S(x()&&!Dn(),this.auth,"internal-error"),await function(){let e=null;return new Promise(t=>{"complete"!==document.readyState?(e=()=>t(),window.addEventListener("load",e)):t()}).catch(t=>{throw e&&window.removeEventListener("load",e),t})}(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const e=await async function(e){return(await q(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}(this.auth);S(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return S(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class Wn{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){const t=et._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function Qn(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(I(e));const o=De(e),s=await Xn(o,t,Object(i.p)(n));return new Wn(s,e=>St(o,e))}async function Yn(e,t,n){const r=Object(i.p)(e);await It(!1,r,"phone");const o=await Xn(r.auth,t,Object(i.p)(n));return new Wn(o,e=>At(r,e))}async function Jn(e,t,n){const o=Object(i.p)(e);if(Object(r._isFirebaseServerApp)(o.auth.app))return Promise.reject(I(o.auth));const s=await Xn(o.auth,t,Object(i.p)(n));return new Wn(s,e=>Ct(o,e))}async function Xn(e,t,n){var r;const i=await n.verify();try{let o;if(S("string"==typeof i,e,"argument-error"),S("recaptcha"===n.type,e,"argument-error"),o="string"==typeof t?{phoneNumber:t}:t,"session"in o){const t=o.session;if("phoneNumber"in o)return S("enroll"===t.type,e,"internal-error"),(await function(e,t){return q(e,"POST","/v2/accounts/mfaEnrollment:start",j(e,t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:o.phoneNumber,recaptchaToken:i}})).phoneSessionInfo.sessionInfo;{S("signin"===t.type,e,"internal-error");const n=(null===(r=o.multiFactorHint)||void 0===r?void 0:r.uid)||o.multiFactorUid;return S(n,e,"missing-multi-factor-info"),(await function(e,t){return q(e,"POST","/v2/accounts/mfaSignIn:start",j(e,t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:i}})).phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return q(e,"POST","/v1/accounts:sendVerificationCode",j(e,t))}(e,{phoneNumber:o.phoneNumber,recaptchaToken:i});return t}}finally{n._reset()}}async function Zn(e,t){const n=Object(i.p)(e);if(Object(r._isFirebaseServerApp)(n.auth.app))return Promise.reject(I(n.auth));await wt(n,t)}class er{constructor(e){this.providerId=er.PROVIDER_ID,this.auth=De(e)}verifyPhoneNumber(e,t){return Xn(this.auth,e,Object(i.p)(t))}static credential(e,t){return et._fromVerification(e,t)}static credentialFromResult(e){const t=e;return er.credentialFromTaggedObject(t)}static credentialFromError(e){return er.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:n}=e;return t&&n?et._fromTokenResponse(t,n):null}}function tr(e,t){return t?he(t):(S(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}er.PROVIDER_ID="phone",er.PHONE_SIGN_IN_METHOD="phone";class nr extends Be{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Je(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Je(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Je(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 rr(e){return Et(e.auth,new nr(e),e.bypassAuthState)}function ir(e){const{auth:t,user:n}=e;return S(n,t,"internal-error"),Tt(n,new nr(e),e.bypassAuthState)}async function or(e){const{auth:t,user:n}=e;return S(n,t,"internal-error"),wt(n,new nr(e),e.bypassAuthState)}class sr{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:o,type:s}=e;if(o)return void this.reject(o);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(s)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return rr;case"linkViaPopup":case"linkViaRedirect":return or;case"reauthViaPopup":case"reauthViaRedirect":return ir;default:v(this.auth,"internal-error")}}resolve(e){C(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){C(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 ar=new D(2e3,1e4);async function ur(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(b(e,"operation-not-supported-in-this-environment"));const i=De(e);T(e,t,it);const o=tr(i,n);return new hr(i,"signInViaPopup",t,o).executeNotNull()}async function lr(e,t,n){const o=Object(i.p)(e);if(Object(r._isFirebaseServerApp)(o.auth.app))return Promise.reject(b(o.auth,"operation-not-supported-in-this-environment"));T(o.auth,t,it);const s=tr(o.auth,n);return new hr(o.auth,"reauthViaPopup",t,s,o).executeNotNull()}async function cr(e,t,n){const r=Object(i.p)(e);T(r.auth,t,it);const o=tr(r.auth,n);return new hr(r.auth,"linkViaPopup",t,o,r).executeNotNull()}
1class hr extends sr{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,hr.currentPopupAction&&hr.currentPopupAction.cancel(),hr.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return S(e,this.auth,"internal-error"),e}async onExecution(){C(1===this.filter.length,"Popup operations only handle one event");const e=kn();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(b(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(b(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,hr.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(b(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,ar.get())};e()}}hr.currentPopupAction=null;const dr=new Map;class fr extends sr{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=dr.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=yr(t),r=_r(e);if(!await r._isAvailable())return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}dr.set(this.auth._key(),e)}return this.bypassAuthState||dr.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}async function pr(e,t){return _r(e)._set(yr(t),"true")}function mr(){dr.clear()}function gr(e,t){dr.set(e._key(),t)}function _r(e){return he(e._redirectPersistence)}function yr(e){return pe("pendingRedirect",e.config.apiKey,e.name)}function vr(e,t,n){return async function(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(I(e));const i=De(e);T(e,t,it),await i._initializationPromise;const o=tr(i,n);return await pr(o,i),o._openRedirect(i,t,"signInViaRedirect")}(e,t,n)}function br(e,t,n){return async function(e,t,n){const o=Object(i.p)(e);if(T(o.auth,t,it),Object(r._isFirebaseServerApp)(o.auth.app))return Promise.reject(I(o.auth));await o.auth._initializationPromise;const s=tr(o.auth,n);await pr(s,o.auth);const a=await Er(o);return s._openRedirect(o.auth,t,"reauthViaRedirect",a)}(e,t,n)}function wr(e,t,n){return async function(e,t,n){const r=Object(i.p)(e);T(r.auth,t,it),await r.auth._initializationPromise;const o=tr(r.auth,n);await It(!1,r,t.providerId),await pr(o,r.auth);const s=await Er(r);return o._openRedirect(r.auth,t,"linkViaRedirect",s)}(e,t,n)}async function Ir(e,t){return await De(e)._initializationPromise,Tr(e,t,!1)}async function Tr(e,t,n=!1){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(I(e));const i=De(e),o=tr(i,t),s=new fr(i,o,n),a=await s.execute();return a&&!n&&(delete a.user._redirectEventId,await i._persistUserIfCurrent(a.user),await i._setRedirectUser(null,t)),a}async function Er(e){const t=kn(e.uid+":::");return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}class Sr{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;
1return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Cr(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!Cr(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(b(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Ar(e))}saveEventToCache(e){this.cachedEventUids.add(Ar(e)),this.lastProcessedEventTime=Date.now()}}function Ar(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function Cr({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null==t?void 0:t.code)}async function kr(e,t={}){return q(e,"GET","/v1/projects",t)}const xr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Nr=/^https?/;function Dr(e){const t=k(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!Nr.test(n))return!1;if(xr.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const Or=new D(3e4,6e4);function Rr(){const e=Nn().___jsl;if(null==e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}let Pr=null;const Lr=new D(5e3,15e3),jr={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},qr=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Mr(e){const t=e.config;S(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?O(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,o={apiKey:t.apiKey,appName:e.name,v:r.SDK_VERSION},s=qr.get(e.config.apiHost);s&&(o.eid=s);const a=e._getFrameworks();return a.length&&(o.fw=a.join(",")),`${n}?${Object(i.A)(o).slice(1)}`}async function Fr(e){const t=await function(e){return Pr=Pr||function(e){return new Promise((t,n)=>{var r,i,o;function s(){Rr(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Rr(),n(b(e,"network-request-failed"))},timeout:Or.get()})}if(null===(i=null===(r=Nn().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(o=Nn().gapi)||void 0===o?void 0:o.load)){const t=Le("iframefcb");return Nn()[t]=()=>{gapi.load?s():n(b(e,"network-request-failed"))},Pe(`${Re.gapiScript}?onload=${t}`).catch(e=>n(e))}s()}}).catch(e=>{throw Pr=null,e})}(e),Pr}(e),n=Nn().gapi;return S(n,e,"internal-error"),t.open({where:document.body,url:Mr(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:jr,dontclear:!0},t=>new Promise(async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=b(e,"network-request-failed"),o=Nn().setTimeout(()=>{r(i)},Lr.get());function s(){Nn().clearTimeout(o),n(t)}t.ping(s).then(s,()=>{r(i)})}))}const Ur={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class zr{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function Vr(e,t,n,r=500,o=600){const s=Math.max((window.screen.availHeight-o)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let u="";const l=Object.assign(Object.assign({},Ur),{width:r.toString(),height:o.toString(),top:s,left:a}),c=Object(i.q)().toLowerCase();n&&(u=ve(c)?"_blank":n),_e(c)&&(t=t||"http://localhost",l.scrollbars="yes");const h=Object.entries(l).reduce((e,[t,n])=>`${e}${t}=${n},`,"");if(function(e=Object(i.q)()){var t;return Ee(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(c)&&"_self"!==u)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");
1r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",u),new zr(null);const d=window.open(t||"",u,h);S(d,e,"popup-blocked");try{d.focus()}catch(e){}return new zr(d)}const Br=encodeURIComponent("fac");async function Gr(e,t,n,o,s,a){S(e.config.authDomain,e,"auth-domain-config-required"),S(e.config.apiKey,e,"invalid-api-key");const u={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:o,v:r.SDK_VERSION,eventId:s};if(t instanceof it){t.setDefaultLanguage(e.languageCode),u.providerId=t.providerId||"",Object(i.t)(t.getCustomParameters())||(u.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(a||{}))u[e]=t}if(t instanceof ot){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(u.scopes=e.join(","))}e.tenantId&&(u.tid=e.tenantId);const l=u;for(const e of Object.keys(l))void 0===l[e]&&delete l[e];const c=await e._getAppCheckToken(),h=c?`#${Br}=${encodeURIComponent(c)}`:"";return`${function({config:e}){return e.emulator?O(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${Object(i.A)(l).slice(1)}${h}`}const Hr=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=An,this._completeRedirectFn=Tr,this._overrideRedirectResult=gr}async _openPopup(e,t,n,r){var i;return C(null===(i=this.eventManagers[e._key()])||void 0===i?void 0:i.manager,"_initialize() not called before _openPopup()"),Vr(e,await Gr(e,t,n,k(),r),kn())}async _openRedirect(e,t,n,r){return await this._originValidation(e),function(e){Nn().location.href=e}(await Gr(e,t,n,k(),r)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(C(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await Fr(e),n=new Sr(e);return t.register("authEvent",t=>(S(null==t?void 0:t.authEvent,e,"invalid-auth-event"),{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send("webStorageSupport",{type:"webStorageSupport"},n=>{var r;const i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.webStorageSupport;void 0!==i&&t(!!i),v(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=async function(e){if(e.config.emulator)return;const{authorizedDomains:t}=await kr(e);for(const n of t)try{if(Dr(n))return}catch(e){}v(e,"unauthorized-domain")}(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Ae()||ye()||Ee()}};class Kr{constructor(e){this.factorId=e}_process(e,t,n){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,n);case"signin":return this._finalizeSignIn(e,t.credential);default:return A("unexpected MultiFactorSessionType")}}}class $r extends Kr{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new $r(e)}_finalizeEnroll(e,t,n){return function(e,t){return q(e,"POST","/v2/accounts/mfaEnrollment:finalize",j(e,t))}(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return function(e,t){return q(e,"POST","/v2/accounts/mfaSignIn:finalize",j(e,t))}(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class Wr{constructor(){}static assertion(e){return $r._fromCredential(e)}}Wr.FACTOR_ID="phone";class Qr{static assertionForEnrollment(e,t){return Yr._fromSecret(e,t)}static assertionForSignIn(e,t){return Yr._fromEnrollmentId(e,t)}static async generateSecret(e){var t;const n=e;S(void 0!==(null===(t=n.user)||void 0===t?void 0:t.auth),"internal-error");const r=await(i=n.user.auth,o={idToken:n.credential,totpEnrollmentInfo:{}},q(i,"POST","/v2/accounts/mfaEnrollment:start",j(i,o)));var i,o;return Jr._fromStartTotpMfaEnrollmentResponse(r,n.user.auth)}}Qr.FACTOR_ID="totp";class Yr extends Kr{constructor(e,t,n){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=n}static _fromSecret(e,t){return new Yr(t,void 0,e)}static _fromEnrollmentId(e,t){return new Yr(t,e)}async _finalizeEnroll(e,t,n){return S(void 0!==this.secret,e,"argument-error"),function(e,t){return q(e,"POST","/v2/accounts/mfaEnrollment:finalize",j(e,t))}(e,{idToken:t,displayName:n,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)})}async _finalizeSignIn(e,t){S(void 0!==this.enrollmentId&&void 0!==this.otp,e,"argument-error");const n={verificationCode:this.otp};return function(e,t){return q(e,"POST","/v2/accounts/mfaSignIn:finalize",j(e,t))}(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:n})}}class Jr{constructor(e,t,n,r,i,o,s){this.sessionInfo=o,this.auth=s,this.secretKey=e,this.hashingAlgorithm=t,this.co
1deLength=n,this.codeIntervalSeconds=r,this.enrollmentCompletionDeadline=i}static _fromStartTotpMfaEnrollmentResponse(e,t){return new Jr(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,t)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){var n;let r=!1;return(Xr(e)||Xr(t))&&(r=!0),r&&(Xr(e)&&(e=(null===(n=this.auth.currentUser)||void 0===n?void 0:n.email)||"unknownuser"),Xr(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function Xr(e){return void 0===e||0===(null==e?void 0:e.length)}var Zr="@firebase/auth";class ei{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}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e((null==t?void 0:t.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(){S(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const ti=Object(i.o)("authIdTokenMaxAge")||300;let ni=null;function ri(e=Object(r.getApp)()){const t=Object(r._getProvider)(e,"auth");if(t.isInitialized())return t.getImmediate();const n=Fe(e,{popupRedirectResolver:Hr,persistence:[Fn,En,An]}),o=Object(i.o)("authTokenSyncURL");if(o&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(o,location.origin);if(location.origin===e.origin){const t=(s=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>ti)return;const r=null==t?void 0:t.token;ni!==r&&(ni=r,await fetch(s,{method:r?"POST":"DELETE",headers:r?{Authorization:"Bearer "+r}:{}}))});ln(n,t,()=>t(n.currentUser)),un(n,e=>t(e))}}var s;const a=Object(i.m)("auth");return a&&Ue(n,"http://"+a),n}var ii;Re={loadJS:e=>new Promise((t,n)=>{const r=document.createElement("script");var i,o;r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=b("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",(null!==(o=null===(i=document.getElementsByTagName("head"))||void 0===i?void 0:i[0])&&void 0!==o?o:document).appendChild(r)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},ii="Browser",Object(r._registerComponent)(new a.a("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:o,authDomain:s}=n.options;S(o&&!o.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:o,authDomain:s,clientPlatform:ii,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Ce(ii)},u=new Ne(n,r,i,a);return function(e,t){const n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(he);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(u,t),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),Object(r._registerComponent)(new a.a("auth-internal",e=>(e=>new ei(e))(De(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),Ob
vendor: 5,065 bytes, line 1
1ject(r.registerVersion)(Zr,"1.7.3",function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(ii)),Object(r.registerVersion)(Zr,"1.7.3","esm2017")},1:function(e,t,n){"use strict";(function(e,r){n.d(t,"a",function(){return m}),n.d(t,"b",function(){return k}),n.d(t,"c",function(){return C}),n.d(t,"d",function(){return u}),n.d(t,"e",function(){return a}),n.d(t,"f",function(){return N}),n.d(t,"g",function(){return g}),n.d(t,"h",function(){return q}),n.d(t,"i",function(){return O}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return j}),n.d(t,"l",function(){return f}),n.d(t,"m",function(){return h}),n.d(t,"n",function(){return d}),n.d(t,"o",function(){return p}),n.d(t,"p",function(){return U}),n.d(t,"q",function(){return _}),n.d(t,"r",function(){return b}),n.d(t,"s",function(){return w}),n.d(t,"t",function(){return D}),n.d(t,"u",function(){return T}),n.d(t,"v",function(){return S}),n.d(t,"w",function(){return y}),n.d(t,"x",function(){return v}),n.d(t,"y",function(){return I}),n.d(t,"z",function(){return E}),n.d(t,"A",function(){return P}),n.d(t,"B",function(){return L}),n.d(t,"C",function(){return A});const i=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},o={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){const i=e[t],o=t+1<e.length,s=o?e[t+1]:0,a=t+2<e.length,u=a?e[t+2]:0,l=i>>2,c=(3&i)<<4|s>>4;let h=(15&s)<<2|u>>6,d=63&u;a||(d=64,o||(h=64)),r.push(n[l],n[c],n[h],n[d])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(i(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const o=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else{const o=e[n++],s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const i=n[e.charAt(t++)],o=t<e.length?n[e.charAt(t)]:0;++t;const a=t<e.length?n[e.charAt(t)]:64;++t;const u=t<e.length?n[e.charAt(t)]:64;if(++t,null==i||null==o||null==a||null==u)throw new s;const l=i<<2|o>>4;if(r.push(l),64!==a){const e=o<<4&240|a>>2;if(r.push(e),64!==u){const e=a<<6&192|u;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class s extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const a=function(e){return function(e){const t=i(e);return o.encodeByteArray(t,!0)}(e).replace(/\./g,"")},u=function(e){try{return o.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function l(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const n in t)t.hasOwnProperty(n)&&"__proto__"!==n&&(e[n]=l(e[n],t[n]));return e}const c=()=>{try{return function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__||(()=>{if(void 0===r||void 0===r.env)return;const e=r.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;
1]+)/)}catch(e){return}const t=e&&u(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info("Unable to get __FIREBASE_DEFAULTS__ due to: "+e)}},h=e=>{var t,n;return null===(n=null===(t=c())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},d=e=>{const t=h(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},f=()=>{var e;return null===(e=c())||void 0===e?void 0:e.config},p=e=>{var t;return null===(t=c())||void 0===t?void 0:t["_"+e]};class m{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function g(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",r=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:"https://securetoken.google.com/"+n,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[a(JSON.stringify({alg:"none",type:"JWT"})),a(JSON.stringify(o)),""].join(".")}function _(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function y(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(_())}function v(){var t;const n=null===(t=c())||void 0===t?void 0:t.forceEnvironment;if("node"===n)return!0;if("browser"===n)return!1;try{return"[object process]"===Object.prototype.toString.call(e.process)}catch(e){return!1}}function b(){return"object"==typeof self&&self.self===self}function w(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function I(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function T(){const e=_();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function E(){return!v()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function S(){try{return"object"==typeof indexedDB}catch(e){return!1}}function A(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})}class C extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,C.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,k.prototype.create)}}class k{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],o=i?function(e,t){return e.replace(x,(e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`})}(i,n):"Error",s=`${this.serviceName}: ${o} (${r}).`;return new C(r,s,n)}}const x=/\{\$([^}]+)}/g;function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function D(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function O(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],o=t[i];if(R(n)&&R(o)){if(!O(n,o))return!1}else if(n!==o)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function R(e){return null!==e&&"object"==typeof e}function P(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function L(e){const t={};
1return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function j(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}function q(e,t){const n=new M(e,t);return n.subscribe.bind(n)}class M{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e){if("object"!=typeof e||null===e)return!1;for(const t of["next","error","complete"])if(t in e&&"function"==typeof e[t])return!0;return!1}(e)?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=F),void 0===r.error&&(r.error=F),void 0===r.complete&&(r.complete=F);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function F(){}function U(e){return e&&e._delegate?e._delegate:e}}).call(this,n(10),n(22))},10:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},12:function(e,t,n){var r,i;r=[n(27)],void 0===(i=function(e){var t={dev:0,staging:0,localStorage:0,forTouch:0,contentTypes:["image","video","audio","page","poll","file","listing","tag","category","gallery"],searchableContentTypes:["article","image","video","audio","file","poll","tag","category"],editorAutosave:0,audio:{sample:"/assets/editor/sample.m4a",base_url:"/uploads"},image:{base_url:"/files",originals_base_url:"/",focal_point_edit_url:"/image/focal-point-edit",upload_url:"uploads",placeholder:"assets/editor/image_placeholder.jpg",main_base_domain:"",main_domain:"https://imagenes.eldebate.com"},imagine_filters:{original:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[6e3,4e3],mode:"inset"}},post_processors:[]},admin_edit:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[194,144],mode:"outbound"}},post_processors:[]},admin_dashboard:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[60,60],mode:"outbound"}},post_processors:[]},admin_search_results:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[75,75],mode:"outbound"}},post_processors:[]},admin_content_thumbnail:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[210,250],mode:"outbound",alignment:"top middle"}},post_processors:[]},admin_user_avatar:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[100,100],mode:"outbound",alignment:"top"}},post_processors:[]},admin_sort_modules:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[40,40],mode:"outbound",alignment:"top"}},post_processors:[]},main_image:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[940,411],mode:"outbound"}},post_processors:[]},new_main_image:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,525],mode:"outbound"}},post_processors:[]},content_image:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[800,600],mode:"inset"}},post_processors:[]},og_thumbnail:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,675],mode:"outbound",alignment:"top"}},post_processors:[]},image_32_32:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[32,32],mode:"outbound"}},post_processors:[]},image_72_72:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[72,72],mode:"outbound"}},post_processors:[]},image_60_63:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[60,63],mode:"outbound"}},post_processors:[]},image_106_106:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[106,106],mode:"outbound"}},post_processors:[]},image_120_120:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,120],mode:"outbound"}},post_processors:[]},composte_image:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[940,414],mode:"outbound"}},post_processors:[]},vertical_composte_image:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:940}},post_processors:[]},related_image:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,90],mode:"outbound"}},post_processors:[]},related_article_image:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,353],mode:"outbound"}},post_processors:[]},author_avatar:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[183,183],mode:"inset"}},post_processors:[]},main_gallery:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[780,520],mode:"outbound"}},post_processors:[]},article_social:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_95:{quality:95,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_90:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_80:{quality:80,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_75:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_50:{quality:50,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_watermark:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630],mode:"outbound"},background:{color:"#FFFFFF"},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},image_150_240:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[150,240],mode:"outbound"}},post_processors:[]},image_140_200:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[140,200],mode:"outbound"}},post_processors:[]},image_240_180:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound"}},post_processors:[]},image_240_180_mob:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound"}},post_processors:[]},image_100_161:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[100,161],mode:"outbound"}},post_processors:[]},image_100_75:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[100,75],mode:"outbound"}},post_processors:[]},image_380_214:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[380,214],mode:"outbound"}},post_processors:[]},image_220_335:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,335],mode:"outbound"}},post_processors:[]},image_120_180:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,180],mode:"outbound"}},post_processors:[]},image_183_277:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[183,277],mode:"outbound"}},post_processors:[]},image_168_16:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[168,16],mode:"outbound"}},post_processors:[]},image_948_465:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[948,465],mode:"inset"}},post_processors:[]},image_344_195:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[344,195],mode:"outbound"}},post_processors:[]},image_70_70:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[70,70],mode:"inset"}},post_processors:[]},image_183_183:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[183,183],mode:"outbound"}},post_processors:[]},image_183_137:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[183,137],mode:"outbound"}},post_processors:[]},image_100_100:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[100,100],mode:"inset"}},post_processors:[]},image_110_100:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[110,100],mode:"outbound"}},post_processors:[]},image_105_105:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[105,105],mode:"inset"}},post_processors:[]},image_120_90:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,90],mode:"outbound"}},post_processors:[]},image_125_115:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[125,115],mode:"outbound"}},post_processors:[]},image_140_140:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[140,140],mode:"outbound"}},post_processors:[]},image_114_114:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[114,114],mode:"outbound"}},post_processors:[]},image_60_60:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[60,60],mode:"outbound"}},post_processors:[]},image_180_180:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[180,180],mode:"outbound"}},post_processo
1rs:[]},image_220_164:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,164],mode:"outbound"}},post_processors:[]},image_300_170:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[300,170],mode:"outbound"}},post_processors:[]},image_300_170_mob:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[300,170],mode:"outbound"}},post_processors:[]},image_414_235:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[414,235],mode:"outbound"}},post_processors:[]},image_414_414:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[414,414],mode:"outbound"}},post_processors:[]},image_300_400:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[300,400],mode:"outbound"}},post_processors:[]},image_414_235_mob:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[414,235],mode:"outbound"}},post_processors:[]},image_293_166:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[293,166],mode:"outbound"}},post_processors:[]},image_293_166_mob:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[293,166],mode:"outbound"}},post_processors:[]},image_300_300:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[300,300],mode:"outbound"}},post_processors:[]},image_300_300_mob:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[300,300],mode:"outbound"}},post_processors:[]},image_382_382:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[382,382],mode:"outbound"}},post_processors:[]},image_362_270:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[362,270],mode:"outbound"}},post_processors:[]},image_362_270_mob:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[362,270],mode:"outbound"}},post_processors:[]},image_375_280:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[375,280],mode:"outbound"}},post_processors:[]},image_414_309:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[414,309],mode:"outbound"}},post_processors:[]},image_414_309_mob:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[414,309],mode:"outbound"}},post_processors:[]},image_360_200:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[360,200],mode:"outbound"}},post_processors:[]},image_360_267:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[360,267],mode:"outbound"}},post_processors:[]},image_400_533:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[400,533],mode:"outbound"}},post_processors:[]},image_414_176:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[414,176],mode:"outbound"}},post_processors:[]},image_460_345:{quality:60,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[460,345],mode:"outbound"}},post_processors:[]},image_460_345_mob:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[460,345],mode:"outbound"}},post_processors:[]},image_620_348:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,348],mode:"outbound"}},post_processors:[]},image_620_348_amp:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,348],mode:"outbound"}},post_processors:[]},image_620_348_mob:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,348],mode:"outbound"}},post_processors:[]},image_620_400:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,400],mode:"outbound"}},post_processors:[]},image_620_400_mob:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,400],mode:"outbound"}},post_processors:[]},image_620_467:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,467],mode:"outbound"}},post_processors:[]},image_620_467_mob:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,467],mode:"outbound"}},post_processors:[]},image_16_9_desktop:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[620,350],mode:"outbound"}},post_processors:[]},image_16_9_mob:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[376,212],mode:"outbound"}},post_processors:[]},image_940_400:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[940,400],mode:"outbound"}},post_processors:[]},image_940_400_mob:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[940,400],mode:"outbound"}},post_processors:[]},image_940_414:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[940,414],mode:"outbound"}},post_processors:[]},image_980_431:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[980,431],mode:"outbound"}},post_processors:[]},image_980_550:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[980,550],mode:"outbound"}},post_processors:[]},image_940_528:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[940,528],mode:"outbound"}},post_processors:[]},image_140_104:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[140,104],mode:"outbound"}},post_processors:[]},image_140_95:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[140,95],mode:"outbound"}},post_processors:[]},image_382_216:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[382,216],mode:"outbound",alignment:"top middle"}},post_processors:[]},image_382_287:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[382,287
1],mode:"outbound"}},post_processors:[]},image_100_151:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[100,151],mode:"outbound"}},post_processors:[]},image_50_67:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[50,67],mode:"outbound"}},post_processors:[]},image_80_80:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[80,80],mode:"outbound"}},post_processors:[]},image_940_353:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[940,353],mode:"outbound"}},post_processors:[]},image_940_353_mob:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[940,353],mode:"outbound"}},post_processors:[]},image_wink:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[125,20],mode:"outbound"}},post_processors:[]},listing_more:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,164],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_sidebar:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[100,103],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_secondary:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,90],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_secondary_big:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[300,170],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_may_interest:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[460,258],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_author:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[100,103],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_opinion:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[100,103],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_main:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,90],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_search:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,90],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_tag_articles:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,90],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_author_home:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,90],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_books_section:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,333],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_lomas_visto:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,333],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_schedule_1:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,333],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_schedule_2:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,333],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_lomas_leido:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,333],mode:"outbound",groups:["listing"]}},post_processors:[]},watermark_filter:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_95:{quality:95,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_90:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_80:{quality:80,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_75:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_50:{quality:50,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,630]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},image_280:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:280}},post_processors:[]},image_300:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:300}},post_processors:[]},image_160:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:160}},post_processors:[]},image_600_340:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[600,340],mode:"outbound"}},post_processors:[]},image_1200_680:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,680],mode:"outbound"}},post_processors:[]},icon_share_footer:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[20,20],mode:"outbound"}},post_processors:[]}
1,logo_footer:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[311,32],mode:"outbound"}},post_processors:[]},main_image_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1880,822],mode:"outbound"}},post_processors:[]},new_main_image_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,525],mode:"outbound"}},post_processors:[]},content_image_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1600,1200],mode:"inset"}},post_processors:[]},og_thumbnail_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1350],mode:"outbound",alignment:"top"}},post_processors:[]},image_32_32_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[64,64],mode:"outbound"}},post_processors:[]},image_72_72_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[144,144],mode:"outbound"}},post_processors:[]},image_60_63_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,126],mode:"outbound"}},post_processors:[]},image_106_106_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[212,212],mode:"outbound"}},post_processors:[]},image_120_120_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,240],mode:"outbound"}},post_processors:[]},composte_image_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1880,828],mode:"outbound"}},post_processors:[]},vertical_composte_image_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:1880}},post_processors:[]},related_image_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound"}},post_processors:[]},coupons_image:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[400,300],mode:"outbound"}},post_processors:[]},related_article_image_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1240,706],mode:"outbound"}},post_processors:[]},author_avatar_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[366,366],mode:"inset"}},post_processors:[]},main_gallery_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1560,1040],mode:"outbound"}},post_processors:[]},article_social_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_95_retina:{quality:95,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_90_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_80_retina:{quality:80,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_75_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_50_retina:{quality:50,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260],mode:"outbound"},background:{color:"#FFFFFF"}},post_processors:[]},article_social_watermark_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:"jpg",animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260],mode:"outbound"},background:{color:"#FFFFFF"},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},image_150_240_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[300,480],mode:"outbound"}},post_processors:[]},image_140_200_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[280,400],mode:"outbound"}},post_processors:[]},image_240_180_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[480,360],mode:"outbound"}},post_processors:[]},image_240_180_mob_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[480,360],mode:"outbound"}},post_processors:[]},image_100_161_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[200,322],mode:"outbound"}},post_processors:[]},image_100_75_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[200,150],mode:"outbound"}},post_processors:[]},image_380_214_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[760,428],mode:"outbound"}},post_processors:[]},image_220_335_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[440,670],mode:"outbound"}},post_processors:[]},image_120_180_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,360],mode:"outbound"}},post_processors:[]},image_183_277_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[366,554],mode:"outbound"}},post_processors:[]},image_168_16_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[336,32],mode:"outbound"}},post_processors:[]},image_948_465_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1896,930],mode:"inset"}},post_processors:[]},image_344_195_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[688,390],mode:"outbound"}},post_processors:[]},image_70_70_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[140,140],mode:"inset"}},post_processors:[]},image_183_183_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[366,366],mode:"outbound"}},post_processors:[]},image_183_137_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[366,274],mode:"outbound"}},post_processors:[]},image_100_100_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[200,200],mode:"inset"}},post_processors:[]},image_110_100_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[220,200],mode:"inset"}},post_processors:[]},image_105_105_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[210,210],mode:"inset"}},post_processors:[]},image_120_90_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound"}},post_processors:[]},image_114_114_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[228,228],mode:"outbound"}},post_processors:[]},image_125_115_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[250,230],mode:"inset"}},post_processors:[]},image_60_60_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[120,120],mode:"outbound"}},post_processors:[]},image_180_180_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[360,360],mode:"outbound"}},post_processors:[]},image_220_164_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[440,328],mode:"outbound"}},post_processors:[]},image_300_170_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[600,340],mode:"outbound"}},post_processors:[]},image_300_170_mob_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[600,340],mode:"outbound"}},post_processors:[]},image_414_235_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[828,470],mode:"outbound"}},post_processors:[]},image_414_414_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[828,828],mode:"outbound"}},post_processors:[]},image_300_400_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[600,800],mode:"outbound"}},post_processors:[]},image_414_235_mob_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[828,470],mode:"outbound"}},post_processors:[]},image_293_166_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[586,332],mode:"outbound"}},post_processors:[]},image_293_166_mob_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[586,332],mode:"outbound"}},post_processors:[]},image_300_300_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[600,600],mode:"outbound"}},post_processors:[]},image_300_300_mob_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[600,600],mode:"outbound"}},post_processors:[]},image_382_382_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[764,764],mode:"outbound"}},post_processors:[]},image_362_270_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[724,540],mode:"outbound"}},post_processors:[]},image_362_270_mob_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[724,540],mode:"outbound"}},post_processors:[]},image_375_280_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[750,560],mode:"outbound"}},post_processors:[]},image_414_309_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,
1cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[828,618],mode:"outbound"}},post_processors:[]},image_414_309_mob_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[828,618],mode:"outbound"}},post_processors:[]},image_360_267_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[720,534],mode:"outbound"}},post_processors:[]},image_400_533_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[800,1066],mode:"outbound"}},post_processors:[]},image_414_176_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[828,352],mode:"outbound"}},post_processors:[]},image_460_345_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[920,690],mode:"outbound"}},post_processors:[]},image_460_345_mob_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[920,690],mode:"outbound"}},post_processors:[]},image_620_348_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1240,696],mode:"outbound"}},post_processors:[]},image_620_348_mob_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1240,696],mode:"outbound"}},post_processors:[]},image_620_400_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1240,800],mode:"outbound"}},post_processors:[]},image_620_400_mob_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1240,800],mode:"outbound"}},post_processors:[]},image_620_467_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1240,934],mode:"outbound"}},post_processors:[]},image_620_467_mob_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1240,934],mode:"outbound"}},post_processors:[]},image_16_9_desktop_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1240,700],mode:"outbound"}},post_processors:[]},image_16_9_mob_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[752,424],mode:"outbound"}},post_processors:[]},image_940_400_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1880,800],mode:"outbound"}},post_processors:[]},image_940_400_mob_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1880,800],mode:"outbound"}},post_processors:[]},image_940_414_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1880,828],mode:"outbound"}},post_processors:[]},image_980_431_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1960,862],mode:"outbound"}},post_processors:[]},image_980_550_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1960,1100],mode:"outbound"}},post_processors:[]},image_940_528_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1880,1056],mode:"outbound"}},post_processors:[]},image_140_104_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[280,208],mode:"outbound"}},post_processors:[]},image_140_95_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[280,190],mode:"outbound"}},post_processors:[]},image_382_216_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[764,432],mode:"outbound",alignment:"top middle"}},post_processors:[]},image_382_287_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[764,574],mode:"outbound"}},post_processors:[]},image_100_151_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[200,302],mode:"outbound"}},post_processors:[]},image_80_80_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[160,160],mode:"outbound"}},post_processors:[]},image_940_353_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1880,706],mode:"outbound"}},post_processors:[]},image_940_353_mob_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1880,706],mode:"outbound"}},post_processors:[]},image_wink_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[250,40],mode:"outbound"}},post_processors:[]},listing_more_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[440,328],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_sidebar_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[200,206],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_secondary_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_secondary_big_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[600,340],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_may_interest_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[920,516],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_author_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[200,206],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_opinion_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[200,206],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_main_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_search_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_tag_articles_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_author_home_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[240,180],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_books_section_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[440,666],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_lomas_visto_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[440,666],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_schedule_1_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[440,666],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_schedule_2_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[440,666],mode:"outbound",groups:["listing"]}},post_processors:[]},listing_lomas_leido_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[440,666],mode:"outbound",groups:["listing"]}},post_processors:[]},watermark_filter_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_95_retina:{quality:95,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_90_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_80_retina:{quality:80,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_75_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},watermark_filter_50_retina:{quality:50,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1260]},watermark:{image:"images/watermark.png",size:1,position:"bottom"}},post_processors:[]},image_280_retina:{quality:75,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:560}},post_processors:[]},image_300_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:600}},post_processors:[]},image_160_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:320}},post_processors:[]},image_600_340_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[1200,680],mode:"outbound"}},post_processors:[]},image_1200_680_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[2400,1360],mode:"outbound"}},post_processors:[]},icon_share_footer_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[40,40],mode:"outbound"}},post_processors:[]},logo_footer_retina:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[622,64],mode:"outbound"}},post_processors:[]},icon_share_header:{quality:90,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[20,20],mode:"outbound"}},post_processors:[]},newsletter_section_card_image:{quality:100,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{wf_thumbnail:{size:[382,214],mode:"outbound"}},post_processors:[]},newsletter_section_example_image:{quality:100,jpeg_quality:null,png_compression_level:null,png_compression_filter:null,format:null,animated:!1,cache:null,data_loader:null,default_image:null,filters:{relative_resize:{widen:640}},post_processors:[]}},video:{sample:"/assets/editor/sample.mp4",base_url:"/uploads",placeholder:"/assets/editor/video_placeholder
1.jpg",main_domain:"",jwplayer_playerId:""},file:{base_url:"/uploads/files",icons_url:"/assets/editor/mime_types",thumbs_upload_url:"/"},editor:{normalizedSwitch:!0,stylesheets:["/bundles/wfcmsbaseassets/stylesheets/jquery-ui/wfcms/screen.css?1782465711","/bundles/appcmsadmin/stylesheets/editor.css?1782465711"]},adminUrl:"/",publicUrl:"https://www.eldebate.com",mobileUrl:"https://m.www.eldebate.com",tabletUrl:"https://www.eldebate.com",ampUrl:"https://www.eldebate.com",twitterUrl:"https://m.www.eldebate.com",platforms:{desktop:{children:[],base_url:"https://www.eldebate.com",template:"___TEMPLATE___",css:"screen.css",inherit_modules:!0,id:"desktop",name:"desktop"},tablet:{width:768,height:1024,children:[],base_url:"https://www.eldebate.com",template:"___TEMPLATE___",css:"screen.css",inherit_modules:!0,id:"tablet",name:"tablet"},mobile:{iframe_class:"mobile",width:360,height:640,children:{"360x640":{body_class:"mobile1",width:360,height:640,base_url:"https://www.eldebate.com",template:"___TEMPLATE___",css:"screen.css",iframe_class:"mobile",inherit_modules:!0,id:"mobile/360x640",name:"360x640"},"375x667":{body_class:"mobile2",width:375,height:667,base_url:"https://www.eldebate.com",template:"___TEMPLATE___",css:"screen.css",iframe_class:"mobile",inherit_modules:!0,id:"mobile/375x667",name:"375x667"},"360x720":{body_class:"mobile3",width:360,height:720,base_url:"https://www.eldebate.com",template:"___TEMPLATE___",css:"screen.css",iframe_class:"mobile",inherit_modules:!0,id:"mobile/360x720",name:"360x720"},"320x568":{body_class:"mobile4",width:320,height:568,base_url:"https://www.eldebate.com",template:"___TEMPLATE___",css:"screen.css",iframe_class:"mobile",inherit_modules:!0,id:"mobile/320x568",name:"320x568"},responsive:{base_url:"https://www.eldebate.com",template:"___TEMPLATE___",css:"screen.css",iframe_class:"mobile",inherit_modules:!0,id:"mobile/responsive",name:"responsive"}},base_url:"https://www.eldebate.com",template:"___TEMPLATE___",css:"screen.css",inherit_modules:!0,id:"mobile",name:"mobile"},facebook:{template:"___TEMPLATE___-facebook",inherit_modules:!1,width:500,body_class:"preview-social-body facebook-body",css:"facebook.css",children:[],base_url:"https://www.eldebate.com",id:"facebook",name:"facebook"},twitter:{template:"___TEMPLATE___-twitter",inherit_modules:!1,width:588,body_class:"preview-social-body twitter-body",css:"twitter.css",children:[],base_url:"https://www.eldebate.com",id:"twitter",name:"twitter"}},assets_version:"",user:{base_url:"/user/show/"},page:{article:{editUrl:"/content/edit/"},board:{editUrl:"/content/edit/"},board_group:{editUrl:"/content/edit/"},homepage:{editUrl:"/content/edit/"},sidebar:{editUrl:"/content/edit/"},"menu-board":{editUrl:"/content/edit/"},metatags:{editUrl:"/content/edit/"},page_listing:{editUrl:"/content/edit/"},page_listing_template:{editUrl:"/content/edit/"},author:{editUrl:"/content/edit/"},tag:{editUrl:"/content/edit/"},ads:{editUrl:"/content/edit/"}},timezone:"Europe/Berlin",galleryTypes:[],ads:{type:"new_google_tags"},node:{host:"admin.eldebate.com",port:443},routes:{tag_search:"/tag/search",listingUrl:"/listing/show",advertisementBannersUrl:"/advertisement/banner/all",contentModels:"/content_models",linkedEntities:"/content/linked_entities",futureUnpublish:"/content/future_unpublish",sortableConfig:"/sortable-config.json",new_board_by_template:"/page/form/board_by_template",assetsCmsBundle:"/bundles/appcms",assetsCmsAdminBundle:"/bundles/appcmsadmin",category_list:"/category/list/%25categorySlug%25"},page_association_names:["category","authors","creator","categories","tags","mainTag","publisher","currentVersion","nextVersion","mainImage"],js_autocollect_translations:!0,microformat:{article_fitler:"article_main_microformat"},vrTest:{url:"/vrtest/fixture/save",isEnabled:0},linkWhitelistDomains:[],article_seo_board_enabled:0,article_seo_board_disabled_fields:[],cmsMainDomain:"www.eldebate.com",firebase:{register_min_years:18,cookie_name:"__pu_k",cookie_user_email:"__c_ue",register_process_cookie_name:"__rp_k",recover_password_cookie_name:"__rpass_k",register_process_user_data:"__u_p",emulator:{ports:{suite_ui:4001,authentication:9099,firestore:8085,realtime_database:9100}},provider_param:"pr",routes:{frontend:{onboarding:{step_1:"/area-privada/suscribete/",step_2:"/area-privada/favoritos/",step_3:"/area-privada/beneficios/"},login:"/login/",private_area:"/area-privada/",profile:"/area-privada/mi-perfil/",register:"/registro/",register_welcome:"/registro/bienvenido/",recover_password:"/registro/contrasena-recuperacion/",recover_password_link_sent:"/registro/contrasena-link-enviado/",reset_password:"/registro/contrasena-restablecer/",change_password:"/area-privada/cambio-contrasena/",delete_account:"/area-privada/eliminar-cuenta/",delete_account_success:"/area-privada/cuenta-eliminada
1/",logout_success:"/area-privada/desconectado/",user_collaborate:"/area-privada/colabora/",newsletters:"/area-privada/newsletters/",newsletters_public:"/newsletters/",comments:"/area-privada/mis-comentarios/",favorites:"/area-privada/mis-favoritos/mis-noticias/",subscriptions:"/area-privada/mis-favoritos/mis-autores/",benefits:"/area-privada/club-el-debate/",private_donations:"/area-privada/colabora/",collaborate:"/area-privada/colabora/",show_article:"/__slug__.html"},backend:{user:{login:"/public-user/login",create:"/public-user/",update:"/public-user/update",delete:"/public-user/delete",has:"/public-user/has/__relation__/__id__",favorites:"/public-user/favorites",subscriptions:"/public-user/subscriptions",after_process:"/public-user/after-process",redeem_coupon:"/public-user/redeem-coupon",hyvor_talk_alias:"/public-user/hyvor-talk-alias"},favorites:{create:"/public-user/favorites/__id__",delete:"/public-user/favorites/__id__/delete",find:"/public-user/favorites/find"},subscriptions:{create:"/public-user/subscriptions/__id__",delete:"/public-user/subscriptions/__id__/delete",find:"/public-user/subscriptions/find",find_letter:"/area-privada/mis-favoritos/mis-autores/search/query/__query__",find_letter_no_query:"/area-privada/mis-favoritos/mis-autores/search/letter/__letter__",find_all:"/area-privada/mis-favoritos/mis-autores/search",paginated_results_authors_activity:"/public-user/subscriptions/authors/activity"},stripe:{list_donations:"/public-user/stripe/list/customer/",create_checkout_session:"/public-user/stripe/create/checkout/session",create_checkout_session_public:"/public-user/stripe/create/checkout/session/public"},newsletters:{check_users_subscriptions_mailchimp:"/public-user/mailchimp/marketing/check_user",subscribe_user_mailchimp:"/public-user/mailchimp/marketing/subscribe_user",unsubscribe_user_mailchimp:"/public-user/mailchimp/marketing/unsubscribe_user"},providers:{oauth_route_generate:"/public-user/provider/oauth-route"}}}}};return t.adminUrl=document.location.protocol+"//"+document.location.host+"/",e.each(t.routes,function(e,n){t.routes[n]=decodeURIComponent(e)}),t}.apply(t,r))||(e.exports=i)},13:function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}n.d(t,"a",function(){return r}),Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},15:function(e,t,n){var r,i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r=[n(33),n(20),n(19)],void 0===(i=function(e,t,n){var r,i,s,a,u=e.INDEXEDDB,l=function(){r=e.createInstance({name:"elDebate",driver:u,storeName:"favorites"}),i=e.createInstance({name:"elDebate",driver:u,storeName:"favorite-pages"}),s=e.createInstance({name:"elDebate",driver:u,storeName:"subscriptions"}),a=e.createInstance({name:"elDebate",driver:u,storeName:"subscription-pages"})},c=function(e){var t="favorites"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"favorites")?i:a;return new Promise(function(n,r){t.iterate(function(n,r,i){r.startsWith(e)&&t.removeItem(r).catch(function(e){console.error("Error al eliminar la llave ".concat(r,":"),e)})}).then(function(){n(!0)}).catch(function(e){console.error("Error al iterar sobre las páginas de favoritos:",e),r(e)})})},h=function(){return new Promise(function(e,t){i.clear().then(function(){r.clear().then(function(){s.clear().then(function(){a.clear().then(function(){console.log("Database is now empty."),e(!0)})})})}).catch(function(e){console.error("Error al iterar sobre las páginas de favoritos:",e),t(e)})})};return{init:function(){l()},syncFavorites:function(e){return l(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";return new Promise(function(n,r){var o="favorite-page-".concat(e);return"false"===window.enableBrowserCache?h().then(function(i){return t.getFavorites(e).then(function(e){n(e)}).catch(function(e){r(e)})}):i.getItem(o).then(function(s){s?n(s):t.getFavorites(e).then(function(e){i.setItem(o,e).then(function(e){n(e)}).catch(function(e){r(e)})}).catch(function(e){r(e)})}).catch(function(e){console.error(e),r(e)})})}(e)},syncSubscriptions:function(e){return l(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";return new Promise(function(t,r){var i="subscription-page-".concat(e);return"false"===window.enableBrowserCache?h().then(function(i){return n.getSubscriptions(e).then(function(e){t(e)}).catch(function(e){r(e)})}):a.getItem(i).then(function(o){o?t(o):n.getSubscriptions(e).then(function(e){a.setItem(i,e).then(function(e){t(e)}).catch(function(e){r(e)})}).catch(function(e){r(e)})}).catch(function(e){console.error(e),r(e)})})}(e)},addRelation:function(e,t,n){return l(),function(e,t,n){return new Promise(function(i,o){var a="favorites"===e?r:s;a?"delete"===t&&"subscriptions"===e?a.iterate(function(e,t,r){e.id===n.id&&a.removeItem(t).catch(function(e){console.error("Error al eliminar la suscripción con llave ".concat(t,":"),e)})}).then(function(e){c("subscription-page-","subscriptions").then(function(){i("delete"===t||e)}).catch(function(e){o(e)})}).catch(function(e){console.error("Error al iterar sobre las suscripciones:",e),o(e)}):("delete"===t?a.removeItem(n.slug):a.setItem(n.slug,{id:n.id,related:!0})).then(function(n){"favorites"===e?c("favorite-page-").then(function(){i("delete"===t||n)}).catch(function(e){o(e)}):c("subscription-page-","subscriptions").then(function(){i("delete"===t||n)}).catch(function(e){o(e)})}).catch(function(e){console.error(e),o(e)}):o(new Error("Invalid relation type"))})}
1(e,t,n)},getFavoriteId:function(){return l(),new Promise(function(e,n){var i=window.location.pathname.slice(1);return i.match(/\.html$/)?(i=i.replace(".html",""),"false"===window.enableBrowserCache?"object"===o(dataLayer[0])&&dataLayer[0].db_idn?e({id:dataLayer[0].db_idn,slug:i}):t.getFavoriteId(i).then(function(t){return e({id:t,slug:i})}).catch(function(e){return console.error(e),n(e)}):r.getItem(i).then(function(s){return s?e({id:s.id,slug:i}):"object"===o(dataLayer[0])&&dataLayer[0].db_idn?r.setItem(i,{id:dataLayer[0].db_idn,related:!1}).then(function(t){return e({id:dataLayer[0].db_idn,slug:i})}):t.getFavoriteId(i).then(function(t){return r.setItem(i,{id:t,related:!1}).then(function(n){return e({id:t,slug:i})})}).catch(function(e){return console.error(e),n(e)})}).catch(function(e){console.error(e)})):n("Invalid favorite URL")})},getSubscriptionId:function(){return l(),new Promise(function(e,t){var r=window.location.pathname.slice(1);return r?(r=r.replace(/^autor\//,"").replace(/\/$/,""),"false"===window.enableBrowserCache?n.getSubscriptionId(r).then(function(t){return e({id:t,slug:r})}).catch(function(e){return console.error(e),t(e)}):s.getItem(r).then(function(i){if(i)return e({id:i.id,slug:r});n.getSubscriptionId(r).then(function(t){return s.setItem(r,{id:t,related:!1}).then(function(n){return e({id:t,slug:r})})}).catch(function(e){return console.error(e),t(e)})}).catch(function(e){console.error("Error al verificar el favorito en el almacenamiento:",e)})):Promise.reject("Invalid subscription URL")})},clearCachePages:function(e){return l(),c(e)},clearAllBrowserCache:function(){return l(),h()},setRelationship:function(e,t,n){return l(),function(e,t,n){return new Promise(function(i,o){var a="favorites"===n?r:s;a?a.setItem(e,t).then(function(t){i({id:t,slug:e})}):o(new Error("Invalid relation type"))})}(e,t,n)},getRelationship:function(e,t){return l(),function(e,t){return new Promise(function(n,i){var o="favorites"===t?r:s;o?"string"==typeof e?o.getItem(e).then(function(e){e&&e.related?n(!0):n(!1)}):i(new Error("Invalid relation slug")):i(new Error("Invalid relation type"))})}(e,t)}}}.apply(t,r))||(e.exports=i)},16:function(e,t,n){var r;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var o=[],s=Object.getPrototypeOf,a=o.slice,u=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},l=o.push,c=o.indexOf,h={},d=h.toString,f=h.hasOwnProperty,p=f.toString,m=p.call(Object),g={},_=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},v=n.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var r,i,o=(n=n||v).createElement("script");if(o.text=e,t)for(r in b)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function I(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?h[d.call(e)]||"object":typeof e}var T="3.7.1",E=/HTML$/i,S=function(e,t){return new S.fn.init(e,t)};function A(e){var t=!!e&&"length"in e&&e.length,n=I(e);return!_(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}S.fn=S.prototype={jquery:T,constructor:S,length:0,toArray:function(){return a.call(this)},get:function(e){return null==e?a.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:l,sort:o.sort,splice:o.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[a]||{},a++),"object"==typeof s||_(s)||(s={}),a===u&&(s=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)r=e[t],"__proto__"!==t&&s!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,s[t]=S.extend(l,o,r)):void 0!==r&&(s[t]=r));return s},S.extend({expando:"jQuery"+(T+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==d.call(e)||(t=s(e))&&("function"!=typeof(n=f.call(t,"constructor")&&t.constructor)||p.call(n)!==m))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){w(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(A(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=S.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(A(Object(e))?S.merge(n,"string"==typeof e?[e]:e):l.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!E.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,s=!n;i<o;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(A(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return u(s)},guid:1,support:g}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=o[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){h["[object "+t+"]"]=t.toLowerCase()});var k=o.pop,x=o.sort,N=o.splice,D="[\\x20\\t\\r\\n\\f]",O=new RegExp("^"+D+"+|((?:^|[^\\\\])(?:\\\\.)*)"+D+"+$","g");S.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var R=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function P(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}S.escapeSelector=function(e){return(e+"").replace(R,P)};var L=v,j=l;!function(){var e,t,r,i,s,u,l,h,d,p,m=j,_=S.expando,y=0,v=0,b=ee(),w=ee(),I=ee(),T=ee(),E=function(e,t){return e===t&&(s=!0),0},A="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="(?:\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",P="\\["+D+"*("+R+")(?:"+D+"*([*^$|!~]?=)"+D+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+D+"*\\]",q=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",M=new RegExp(D+"+","g"),F=new RegExp("^"+D+"*,"+D+"*"),U=new RegExp("^"+D+"*([>+~]|"+D+")"+D+"*"),z=new RegExp(D+"|>"),V=new RegExp(q),B=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+A+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,W=/[+~]/,Q=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),Y=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){ue()},X=de(function(e){return!0===e.disabled&&C(e,"fieldset")},{dir:"parentNode",next:"legend"});try{m.apply(o=a.call(L.childNodes),L.childNodes),o[L.childNodes.length].nodeType}catch(e){m={apply:function(e,t){j.apply(e,a.call(t))}
vendor: 4,608 bytes, line 1
1,call:function(e){j.apply(e,a.call(arguments,1))}}}function Z(e,t,n,r){var i,o,s,a,l,c,f,p=t&&t.ownerDocument,y=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return n;if(!r&&(ue(t),t=t||u,h)){if(11!==y&&(l=$.exec(e)))if(i=l[1]){if(9===y){if(!(s=t.getElementById(i)))return n;if(s.id===i)return m.call(n,s),n}else if(p&&(s=p.getElementById(i))&&Z.contains(t,s)&&s.id===i)return m.call(n,s),n}else{if(l[2])return m.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&t.getElementsByClassName)return m.apply(n,t.getElementsByClassName(i)),n}if(!(T[e+" "]||d&&d.test(e))){if(f=e,p=t,1===y&&(z.test(e)||U.test(e))){for((p=W.test(e)&&ae(t.parentNode)||t)==t&&g.scope||((a=t.getAttribute("id"))?a=S.escapeSelector(a):t.setAttribute("id",a=_)),o=(c=ce(e)).length;o--;)c[o]=(a?"#"+a:":scope")+" "+he(c[o]);f=c.join(",")}try{return m.apply(n,p.querySelectorAll(f)),n}catch(t){T(e,!0)}finally{a===_&&t.removeAttribute("id")}}}return ye(e.replace(O,"$1"),t,n,r)}function ee(){var e=[];return function n(r,i){return e.push(r+" ")>t.cacheLength&&delete n[e.shift()],n[r+" "]=i}}function te(e){return e[_]=!0,e}function ne(e){var t=u.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return C(t,"input")&&t.type===e}}function ie(e){return function(t){return(C(t,"input")||C(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&X(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function se(e){return te(function(t){return t=+t,te(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function ue(e){var n,r=e?e.ownerDocument||e:L;return r!=u&&9===r.nodeType&&r.documentElement&&(l=(u=r).documentElement,h=!S.isXMLDoc(u),p=l.matches||l.webkitMatchesSelector||l.msMatchesSelector,l.msMatchesSelector&&L!=u&&(n=u.defaultView)&&n.top!==n&&n.addEventListener("unload",J),g.getById=ne(function(e){return l.appendChild(e).id=S.expando,!u.getElementsByName||!u.getElementsByName(S.expando).length}),g.disconnectedMatch=ne(function(e){return p.call(e,"*")}),g.scope=ne(function(){return u.querySelectorAll(":scope")}),g.cssHas=ne(function(){try{return u.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),g.getById?(t.filter.ID=function(e){var t=e.replace(Q,Y);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&h){var n=t.getElementById(e);return n?[n]:[]}}):(t.filter.ID=function(e){var t=e.replace(Q,Y);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&h){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&h)return t.getElementsByClassName(e)},d=[],ne(function(e){var t;l.appendChild(e).innerHTML="<a id='"+_+"' href='' disabled='disabled'></a><select id='"+_+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+D+"*(?:value|"+A+")"),e.querySelectorAll("[id~="+_+"-]").length||d.push("~="),e.querySelectorAll("a#"+_+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=u.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),l.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=u.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")")}),g.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),E=function(e,t){if(e===t)return s=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!g.sortDetached&&t.compareDocumentPosition(e)===n?e===u||e.ownerDocument==L&&Z.contains(L,e)?-1:t===u||t.ownerDocument==L&&Z.contains(L,t)?1:i?c.call(i,e)-c.call(i,t):0:4&n?-1:1)}),u}for(e in Z.matches=function(e,t){return Z(e,null,null,t)}
vendor: 4,735 bytes, line 1
1,Z.matchesSelector=function(e,t){if(ue(e),h&&!T[t+" "]&&(!d||!d.test(t)))try{var n=p.call(e,t);if(n||g.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){T(t,!0)}return 0<Z(t,u,null,[e]).length},Z.contains=function(e,t){return(e.ownerDocument||e)!=u&&ue(e),S.contains(e,t)},Z.attr=function(e,n){(e.ownerDocument||e)!=u&&ue(e);var r=t.attrHandle[n.toLowerCase()],i=r&&f.call(t.attrHandle,n.toLowerCase())?r(e,n,!h):void 0;return void 0!==i?i:e.getAttribute(n)},Z.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},S.uniqueSort=function(e){var t,n=[],r=0,o=0;if(s=!g.sortStable,i=!g.sortStable&&a.call(e,0),x.call(e,E),s){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)N.call(e,n[r],1)}return i=null,e},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(a.apply(this)))},(t=S.expr={cacheLength:50,createPseudo:te,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Q,Y),e[3]=(e[3]||e[4]||e[5]||"").replace(Q,Y),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Z.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Z.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=ce(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Q,Y).toLowerCase();return"*"===e?function(){return!0}:function(e){return C(e,t)}},CLASS:function(e){var t=b[e+" "];return t||(t=new RegExp("(^|"+D+")"+e+"("+D+"|$)"))&&b(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=Z.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&-1<i.indexOf(n):"$="===t?n&&i.slice(-n.length)===n:"~="===t?-1<(" "+i.replace(M," ")+" ").indexOf(n):"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,h,d,f,p=o!==s?"nextSibling":"previousSibling",m=t.parentNode,g=a&&t.nodeName.toLowerCase(),v=!u&&!a,b=!1;if(m){if(o){for(;p;){for(h=t;h=h[p];)if(a?C(h,g):1===h.nodeType)return!1;f=p="only"===e&&!f&&"nextSibling"}return!0}if(f=[s?m.firstChild:m.lastChild],s&&v){for(b=(d=(l=(c=m[_]||(m[_]={}))[e]||[])[0]===y&&l[1])&&l[2],h=d&&m.childNodes[d];h=++d&&h&&h[p]||(b=d=0)||f.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[y,d,b];break}}else if(v&&(b=d=(l=(c=t[_]||(t[_]={}))[e]||[])[0]===y&&l[1]),!1===b)for(;(h=++d&&h&&h[p]||(b=d=0)||f.pop())&&(!(a?C(h,g):1===h.nodeType)||!++b||(v&&((c=h[_]||(h[_]={}))[e]=[y,b]),h!==t)););return(b-=i)===r||b%r==0&&0<=b/r}}},PSEUDO:function(e,n){var r,i=t.pseudos[e]||t.setFilters[e.toLowerCase()]||Z.error("unsupported pseudo: "+e);return i[_]?i(n):1<i.length?(r=[e,e,"",n],t.setFilters.hasOwnProperty(e.toLowerCase())?te(function(e,t){for(var r,o=i(e,n),s=o.length;s--;)e[r=c.call(e,o[s])]=!(t[r]=o[s])}):function(e){return i(e,0,r)}):i}},pseudos:{not:te(function(e){var t=[],n=[],r=_e(e.replace(O,"$1"));return r[_]?te(function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:te(function(e){return function(t){return 0<Z(e,t).length}}),contains:te(function(e){return e=e.replace(Q,Y),function(t){return-1<(t.textContent||S.text(t)).indexOf(e)}}),lang:te(function(e){return B.test(e||"")||Z.error("unsupported lang: "+e),e=e.replace(Q,Y).toLowerCase(),function(t){var n;do{if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===l},focus:function(e){return e===function(){try{return u.activeElement}catch(e){}}()&&u.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return C(e,"input")&&!!e.checked||C(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!t.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)}
vendor: 4,556 bytes, line 1
1,input:function(e){return H.test(e.nodeName)},button:function(e){return C(e,"input")&&"button"===e.type||C(e,"button")},text:function(e){var t;return C(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:se(function(){return[0]}),last:se(function(e,t){return[t-1]}),eq:se(function(e,t,n){return[n<0?n+t:n]}),even:se(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:se(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:se(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:se(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=t.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[e]=re(e);for(e in{submit:!0,reset:!0})t.pseudos[e]=ie(e);function le(){}function ce(e,n){var r,i,o,s,a,u,l,c=w[e+" "];if(c)return n?0:c.slice(0);for(a=e,u=[],l=t.preFilter;a;){for(s in r&&!(i=F.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),r=!1,(i=U.exec(a))&&(r=i.shift(),o.push({value:r,type:i[0].replace(O," ")}),a=a.slice(r.length)),t.filter)!(i=G[s].exec(a))||l[s]&&!(i=l[s](i))||(r=i.shift(),o.push({value:r,type:s,matches:i}),a=a.slice(r.length));if(!r)break}return n?a.length:a?Z.error(e):w(e,u).slice(0)}function he(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function de(e,t,n){var r=t.dir,i=t.next,o=i||r,s=n&&"parentNode"===o,a=v++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||s)return e(t,n,i);return!1}:function(t,n,u){var l,c,h=[y,a];if(u){for(;t=t[r];)if((1===t.nodeType||s)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||s)if(c=t[_]||(t[_]={}),i&&C(t,i))t=t[r]||t;else{if((l=c[o])&&l[0]===y&&l[1]===a)return h[2]=l[2];if((c[o]=h)[2]=e(t,n,u))return!0}return!1}}function fe(e){return 1<e.length?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function pe(e,t,n,r,i){for(var o,s=[],a=0,u=e.length,l=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),l&&t.push(a)));return s}function me(e,t,n,r,i,o){return r&&!r[_]&&(r=me(r)),i&&!i[_]&&(i=me(i,o)),te(function(o,s,a,u){var l,h,d,f,p=[],g=[],_=s.length,y=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)Z(e,t[r],n);return n}(t||"*",a.nodeType?[a]:a,[]),v=!e||!o&&t?y:pe(y,p,e,a,u);if(n?n(v,f=i||(o?e:_||r)?[]:s,a,u):f=v,r)for(l=pe(f,g),r(l,[],a,u),h=l.length;h--;)(d=l[h])&&(f[g[h]]=!(v[g[h]]=d));if(o){if(i||e){if(i){for(l=[],h=f.length;h--;)(d=f[h])&&l.push(v[h]=d);i(null,f=[],l,u)}for(h=f.length;h--;)(d=f[h])&&-1<(l=i?c.call(o,d):p[h])&&(o[l]=!(s[l]=d))}}else f=pe(f===s?f.splice(_,f.length):f),i?i(null,s,f,u):m.apply(s,f)})}function ge(e){for(var n,i,o,s=e.length,a=t.relative[e[0].type],u=a||t.relative[" "],l=a?1:0,h=de(function(e){return e===n},u,!0),d=de(function(e){return-1<c.call(n,e)},u,!0),f=[function(e,t,i){var o=!a&&(i||t!=r)||((n=t).nodeType?h(e,t,i):d(e,t,i));return n=null,o}];l<s;l++)if(i=t.relative[e[l].type])f=[de(fe(f),i)];else{if((i=t.filter[e[l].type].apply(null,e[l].matches))[_]){for(o=++l;o<s&&!t.relative[e[o].type];o++);return me(1<l&&fe(f),1<l&&he(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(O,"$1"),i,l<o&&ge(e.slice(l,o)),o<s&&ge(e=e.slice(o)),o<s&&he(e))}f.push(i)}return fe(f)}function _e(e,n){var i,o,s,a,l,c,d=[],f=[],p=I[e+" "];if(!p){for(n||(n=ce(e)),i=n.length;i--;)(p=ge(n[i]))[_]?d.push(p):f.push(p);(p=I(e,(o=f,a=0<(s=d).length,l=0<o.length,c=function(e,n,i,c,d){var f,p,g,_=0,v="0",b=e&&[],w=[],I=r,T=e||l&&t.find.TAG("*",d),E=y+=null==I?1:Math.random()||.1,A=T.length;for(d&&(r=n==u||n||d);v!==A&&null!=(f=T[v]);v++){if(l&&f){for(p=0,n||f.ownerDocument==u||(ue(f),i=!h);g=o[p++];)if(g(f,n||u,i)){m.call(c,f);break}d&&(y=E)}a&&((f=!g&&f)&&_--,e&&b.push(f))}if(_+=v,a&&v!==_){for(p=0;g=s[p++];)g(b,w,n,i);if(e){if(0<_)for(;v--;)b[v]||w[v]||(w[v]=k.call(c));w=pe(w)}m.apply(c,w),d&&!e&&0<w.length&&1<_+s.length&&S.uniqueSort(c)}return d&&(y=E,r=I),b},a?te(c):c))).selector=e}return p}function ye(e,n,r,i){var o,s,a,u,l,c="function"==typeof e&&e,d=!i&&ce(e=c.selector||e);if(r=r||[],1===d.length){if(2<(s=d[0]=d[0].slice(0)).length&&"ID"===(a=s[0]).type&&9===n.nodeType&&h&&t.relative[s[1].type]){if(!(n=(t.find.ID(a.matches[0].replace(Q,Y),n)||[])[0]))return r;c&&(n=n.parentNode),e=e.slice(s.shift().value.length)}for(o=G.needsContext.test(e)?0:s.length;o--&&(a=s[o],!t.relative[u=a.type]);)if((l=t.find[u])&&(i=l(a.matches[0].replace(Q,Y),W.test(s[0].type)&&ae(n.parentNode)||n))){if(s.splice(o,1),!(e=i.length&&he(s)))return m.apply(r,i),r;break}}return(c||_e(e,d))(i,n,!h,r,!n||W.test(e)&&ae(n.parentNode)||n),r}
vendor: 8,706 bytes, line 1
1le.prototype=t.filters=t.pseudos,t.setFilters=new le,g.sortStable=_.split("").sort(E).join("")===_,ue(),g.sortDetached=ne(function(e){return 1&e.compareDocumentPosition(u.createElement("fieldset"))}),S.find=Z,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,Z.compile=_e,Z.select=ye,Z.setDocument=ue,Z.tokenize=ce,Z.escape=S.escapeSelector,Z.getText=S.text,Z.isXML=S.isXMLDoc,Z.selectors=S.expr,Z.support=S.support,Z.uniqueSort=S.uniqueSort}();var q=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},M=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},F=S.expr.match.needsContext,U=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function z(e,t,n){return _(t)?S.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):"string"!=typeof t?S.grep(e,function(e){return-1<c.call(t,e)!==n}):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(z(this,e||[],!1))},not:function(e){return this.pushStack(z(this,e||[],!0))},is:function(e){return!!z(this,"string"==typeof e&&F.test(e)?S(e):e||[],!1).length}});var V,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||V,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:B.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),U.test(r[1])&&S.isPlainObject(t))for(r in t)_(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):_(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,V=S(v);var G=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function K(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],s="string"!=typeof e&&S(e);if(!F.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?-1<s.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(S(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return q(e,"parentNode")},parentsUntil:function(e,t,n){return q(e,"parentNode",n)},next:function(e){return K(e,"nextSibling")},prev:function(e){return K(e,"previousSibling")},nextAll:function(e){return q(e,"nextSibling")},prevAll:function(e){return q(e,"previousSibling")},nextUntil:function(e,t,n){return q(e,"nextSibling",n)},prevUntil:function(e,t,n){return q(e,"previousSibling",n)},siblings:function(e){return M((e.parentNode||{}).firstChild,e)},children:function(e){return M(e.firstChild)},contents:function(e){return null!=e.contentDocument&&s(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,r){var i=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=S.filter(r,i)),1<this.length&&(H[e]||S.uniqueSort(i),G.test(e)&&i.reverse()),this.pushStack(i)}});var $=/[^\x20\t\r\n\f]+/g;function W(e){return e}function Q(e){throw e}function Y(e,t,n,r){var i;try{e&&_(i=e.promise)?i.call(e).done(t).fail(n):e&&_(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){var t,n;e="string"==typeof e?(t=e,n={},S.each(t.match($)||[],function(e,t){n[t]=!0}),n):S.extend({},e);var r,i,o,s,a=[],u=[],l=-1,c=function(){for(s=s||e.once,o=r=!0;u.length;l=-1)for(i=u.shift();++l<a.length;)!1===a[l].apply(i[0],i[1])&&e.stopOnFalse&&(l=a.length,i=!1);e.memory||(i=!1),r=!1,s&&(a=i?[]:"")},h={add:function(){return a&&(i&&!r&&(l=a.length-1,u.push(i)),function t(n){S.each(n,function(n,r){_(r)?e.unique&&h.has(r)||a.push(r):r&&r.length&&"string"!==I(r)&&t(r)})}(arguments),i&&!r&&c()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;-1<(n=S.inArray(t,a,n));)a.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,a):0<a.length},empty:function(){return a&&(a=[]),this},disable:function(){return s=u=[],a=i="",this},disabled:function(){return!a},lock:function(){return s=u=[],i||r||(a=i=""),this},locked:function(){return!!s},fireWith:function(e,t){return s||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),r||c()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!o}};return h},S.extend({Deferred:function(e){var t=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return S.Deferred(function(n){S.each(t,function(t,r){var i=_(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&_(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){var o=0;function s(e,t,r,i){return function(){var a=this,u=arguments,l=function(){var n,l;if(!(e<o)){if((n=r.apply(a,u))===t.promise())throw new TypeError("Thenable self-resolution");l=n&&("object"==typeof n||"function"==typeof n)&&n.then,_(l)?i?l.call(n,s(o,t,W,i),s(o,t,Q,i)):(o++,l.call(n,s(o,t,W,i),s(o,t,Q,i),s(o,t,W,t.notifyWith))):(r!==W&&(a=void 0,u=[n]),(i||t.resolveWith)(a,u))}},c=i?l:function(){try{l()}catch(n){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(n,c.error),o<=e+1&&(r!==Q&&(a=void 0,u=[n]),t.rejectWith(a,u))}};e?c():(S.Deferred.getErrorHook?c.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(c.error=S.Deferred.getStackHook()),n.setTimeout(c))}}return S.Deferred(function(n){t[0][3].add(s(0,n,_(i)?i:W,n.notifyWith)),t[1][3].add(s(0,n,_(e)?e:W)),t[2][3].add(s(0,n,_(r)?r:Q))}).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},o={};return S.each(t,function(e,n){var s=n[2],a=n[5];i[n[1]]=s.add,a&&s.add(function(){r=a},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=a.call(arguments),o=S.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=1<arguments.length?a.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(Y(e,o.done(s(n)).resolve,o.reject,!t),"pending"===o.state()||_(i[n]&&i[n].then)))return o.then();for(;n--;)Y(i[n],s(n),o.reject);return o.promise()}});var J=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&J.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){n.setTimeout(function(){throw e})};var X=S.Deferred();function Z(){v.removeEventListener("DOMContentLoaded",Z),n.removeEventListener("load",Z),S.ready()}S.fn.ready=function(e){return X.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||X.resolveWith(v,[S])}}),S.ready.then=X.then,"complete"===v.readyState||"loading"!==v.readyState&&!v.documentElement.doScroll?n.setTimeout(S.ready):(v.addEventListener("DOMContentLoaded",Z),n.addEventListener("load",Z));var ee=function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;
vendor: 5,737 bytes, line 1
1if("object"===I(n))for(a in i=!0,n)ee(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,_(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;a<u;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},te=/^-ms-/,ne=/-([a-z])/g;function re(e,t){return t.toUpperCase()}function ie(e){return e.replace(te,"ms-").replace(ne,re)}var oe=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function se(){this.expando=S.expando+se.uid++}se.uid=1,se.prototype={cache:function(e){var t=e[this.expando];return t||(t={},oe(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[ie(t)]=n;else for(r in t)i[ie(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ie(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(ie):(t=ie(t))in r?[t]:t.match($)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var ae=new se,ue=new se,le=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ce=/[A-Z]/g;function he(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ce,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:le.test(i)?JSON.parse(i):i)}catch(e){}ue.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return ue.hasData(e)||ae.hasData(e)},data:function(e,t,n){return ue.access(e,t,n)},removeData:function(e,t){ue.remove(e,t)},_data:function(e,t,n){return ae.access(e,t,n)},_removeData:function(e,t){ae.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=ue.get(o),1===o.nodeType&&!ae.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=ie(r.slice(5)),he(o,r,i[r]));ae.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){ue.set(this,e)}):ee(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=ue.get(o,e))||void 0!==(n=he(o,e))?n:void 0;this.each(function(){ue.set(this,e,t)})},null,t,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){ue.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ae.get(e,t),n&&(!r||Array.isArray(n)?r=ae.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ae.get(e,n)||ae.access(e,n,{empty:S.Callbacks("once memory").add(function(){ae.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=ae.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var de=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,fe=new RegExp("^(?:([+-])=|)("+de+")([a-z%]*)$","i"),pe=["Top","Right","Bottom","Left"],me=v.documentElement,ge=function(e){return S.contains(e.ownerDocument,e)},_e={composed:!0};me.getRootNode&&(ge=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(_e)===e.ownerDocument});var ye=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ge(e)&&"none"===S.css(e,"display")};function ve(e,t,n,r){var i,o,s=20,a=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=a(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&fe.exec(S.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;s--;)S.style(e,t,c+l),(1-o)*(1-(o=a()/u||.5))<=0&&(s=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var be={};function we(e,t){for(var n,r,i,o,s,a,u,l=[],c=0,h=e.length;c<h;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=ae.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ye(r)&&(l[c]=(u=s=o=void 0,s=(i=r).ownerDocument,a=i.nodeName,(u=be[a])||(o=s.body.appendChild(s.createElement(a)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),be[a]=u)))):"none"!==n&&(l[c]="none",ae.set(r,"display",n)));for(c=0;c<h;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return we(this,!0)},hide:function(){return we(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ye(this)?S(this).show():S(this).hide()})}});var Ie,Te,Ee=/^(?:checkbox|radio)$/i,Se=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ae=/^$|^module$|\/(?:java|ecma)script/i;Ie=v.createDocumentFragment().appendChild(v.createElement("div")),(Te=v.createElement("input")).setAttribute("type","radio"),Te.setAttribute("checked","checked"),Te.setAttribute("name","t"),Ie.appendChild(Te),g.checkClone
vendor: 5,712 bytes, line 1
1=Ie.cloneNode(!0).cloneNode(!0).lastChild.checked,Ie.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!Ie.cloneNode(!0).lastChild.defaultValue,Ie.innerHTML="<option></option>",g.option=!!Ie.lastChild;var Ce={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ke(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?S.merge([e],n):n}function xe(e,t){for(var n=0,r=e.length;n<r;n++)ae.set(e[n],"globalEval",!t||ae.get(t[n],"globalEval"))}Ce.tbody=Ce.tfoot=Ce.colgroup=Ce.caption=Ce.thead,Ce.th=Ce.td,g.option||(Ce.optgroup=Ce.option=[1,"<select multiple='multiple'>","</select>"]);var Ne=/<|&#?\w+;/;function De(e,t,n,r,i){for(var o,s,a,u,l,c,h=t.createDocumentFragment(),d=[],f=0,p=e.length;f<p;f++)if((o=e[f])||0===o)if("object"===I(o))S.merge(d,o.nodeType?[o]:o);else if(Ne.test(o)){for(s=s||h.appendChild(t.createElement("div")),a=(Se.exec(o)||["",""])[1].toLowerCase(),u=Ce[a]||Ce._default,s.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];c--;)s=s.lastChild;S.merge(d,s.childNodes),(s=h.firstChild).textContent=""}else d.push(t.createTextNode(o));for(h.textContent="",f=0;o=d[f++];)if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ge(o),s=ke(h.appendChild(o),"script"),l&&xe(s),n)for(c=0;o=s[c++];)Ae.test(o.type||"")&&n.push(o);return h}var Oe=/^([^.]*)(?:\.(.+)|)/;function Re(){return!0}function Pe(){return!1}function Le(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Pe;else if(!i)return e;return 1===o&&(s=i,(i=function(e){return S().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function je(e,t,n){n?(ae.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var n,r=ae.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=a.call(arguments),ae.set(this,t,r),this[t](),n=ae.get(this,t),ae.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(ae.set(this,t,S.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Re)}})):void 0===ae.get(e,t)&&S.event.add(e,t,Re)}S.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,h,d,f,p,m,g=ae.get(e);if(oe(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(me,i),n.guid||(n.guid=S.guid++),(u=g.events)||(u=g.events=Object.create(null)),(s=g.handle)||(s=g.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match($)||[""]).length;l--;)f=m=(a=Oe.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),f&&(h=S.event.special[f]||{},f=(i?h.delegateType:h.bindType)||f,h=S.event.special[f]||{},c=S.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:p.join(".")},o),(d=u[f])||((d=u[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,r,p,s)||e.addEventListener&&e.addEventListener(f,s)),h.add&&(h.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),S.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,h,d,f,p,m,g=ae.hasData(e)&&ae.get(e);if(g&&(u=g.events)){for(l=(t=(t||"").match($)||[""]).length;l--;)if(f=m=(a=Oe.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),f){for(h=S.event.special[f]||{},d=u[f=(r?h.delegateType:h.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(e,c));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(e,p,g.handle)||S.removeEvent(e,f,g.handle),delete u[f])}else for(f in u)S.event.remove(e,f+t[l],n,r,!0);S.isEmptyObject(u)&&ae.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=new Array(arguments.length),u=S.event.fix(e),l=(ae.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(a[0]=u,t=1;t<arguments.length;t++)a[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(s=S.event.handlers.call(this,u,l),t=0;(i=s[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,s,a=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],s={},n=0;n<u;n++)void 0===s[i=(r=t[n]).selector+" "]&&(s[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),s[i]&&o.push(r);o.length&&a.push({elem:l,handlers:o})}return l=this,u<t.length&&a.push({elem:l,handlers:t.slice(u)}),a},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:_(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]}
vendor: 3,206 bytes, line 1
1,set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Ee.test(t.type)&&t.click&&C(t,"input")&&je(t,"click",!0),!1},trigger:function(e){var t=this||e;return Ee.test(t.type)&&t.click&&C(t,"input")&&je(t,"click"),!0},_default:function(e){var t=e.target;return Ee.test(t.type)&&t.click&&C(t,"input")&&ae.get(t,"click")||C(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Re:Pe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Pe,isPropagationStopped:Pe,isImmediatePropagationStopped:Pe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Re,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Re,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Re,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){function n(e){if(v.documentMode){var n=ae.get(this,"handle"),r=S.event.fix(e);r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else S.event.simulate(t,e.target,S.event.fix(e))}S.event.special[e]={setup:function(){var r;if(je(this,e,!0),!v.documentMode)return!1;(r=ae.get(this,t))||this.addEventListener(t,n),ae.set(this,t,(r||0)+1)},trigger:function(){return je(this,e),!0},teardown:function(){var e;if(!v.documentMode)return!1;(e=ae.get(this,t)-1)?ae.set(this,t,e):(this.removeEventListener(t,n),ae.remove(this,t))},_default:function(t){return ae.get(t.target,e)},delegateType:t},S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=v.documentMode?this:r,o=ae.get(i,t);o||(v.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),ae.set(i,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=v.documentMode?this:r,o=ae.get(i,t)-1;o?ae.set(i,t,o):(v.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),ae.remove(i,t))}}}
vendor: 5,937 bytes, line 1
1),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||S.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Pe),this.each(function(){S.event.remove(this,e,n,t)})}});var qe=/<script|<style|<link/i,Me=/checked\s*(?:[^=]|=\s*.checked.)/i,Fe=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Ue(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function ze(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ve(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Be(e,t){var n,r,i,o,s,a;if(1===t.nodeType){if(ae.hasData(e)&&(a=ae.get(e).events))for(i in ae.remove(t,"handle events"),a)for(n=0,r=a[i].length;n<r;n++)S.event.add(t,i,a[i][n]);ue.hasData(e)&&(o=ue.access(e),s=S.extend({},o),ue.set(t,s))}}function Ge(e,t,n,r){t=u(t);var i,o,s,a,l,c,h=0,d=e.length,f=d-1,p=t[0],m=_(p);if(m||1<d&&"string"==typeof p&&!g.checkClone&&Me.test(p))return e.each(function(i){var o=e.eq(i);m&&(t[0]=p.call(this,i,o.html())),Ge(o,t,n,r)});if(d&&(o=(i=De(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=(s=S.map(ke(i,"script"),ze)).length;h<d;h++)l=i,h!==f&&(l=S.clone(l,!0,!0),a&&S.merge(s,ke(l,"script"))),n.call(e[h],l,h);if(a)for(c=s[s.length-1].ownerDocument,S.map(s,Ve),h=0;h<a;h++)l=s[h],Ae.test(l.type||"")&&!ae.access(l,"globalEval")&&S.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?S._evalUrl&&!l.noModule&&S._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},c):w(l.textContent.replace(Fe,""),l,c))}return e}function He(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ke(r)),r.parentNode&&(n&&ge(r)&&xe(ke(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,s,a,u,l,c=e.cloneNode(!0),h=ge(e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(s=ke(c),r=0,i=(o=ke(e)).length;r<i;r++)a=o[r],"input"===(l=(u=s[r]).nodeName.toLowerCase())&&Ee.test(a.type)?u.checked=a.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=a.defaultValue);if(t)if(n)for(o=o||ke(e),s=s||ke(c),r=0,i=o.length;r<i;r++)Be(o[r],s[r]);else Be(e,c);return 0<(s=ke(c,"script")).length&&xe(s,!h&&ke(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(oe(n)){if(t=n[ae.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[ae.expando]=void 0}n[ue.expando]&&(n[ue.expando]=void 0)}}}),S.fn.extend({detach:function(e){return He(this,e,!0)},remove:function(e){return He(this,e)},text:function(e){return ee(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ge(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ue(this,e).appendChild(e)})},prepend:function(){return Ge(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ue(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ge(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ge(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ke(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return ee(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!Ce[(Se.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ke(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Ge(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(ke(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){S.fn[e]=function(e){for(var n,r=[],i=S(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),S(i[s])[t](n),l.apply(r,n.get());return this.pushStack(r)}});var Ke=new RegExp("^("+de+")(?!px)[a-z%]+$","i"),$e=/^--/,We=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)},Qe=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ye=new RegExp(pe.join("|"),"i");function Je(e,t,n){var r,i,o,s,a=$e.test(t),u=e.style;return(n=n||We(e))&&(s=n.getPropertyValue(t)||n[t],a&&s&&(s=s.replace(O,"$1")||void 0),""!==s||ge(e)||(s=S.style(e,t)),!g.pixelBoxStyles()&&Ke.test(s)&&Ye.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=s,s=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==s?s+"":s}function Xe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){l.style.cssText="position:absolute;
1left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",me.appendChild(l).appendChild(c);var e=n.getComputedStyle(c);r="1%"!==e.top,u=12===t(e.marginLeft),c.style.right="60%",s=36===t(e.right),i=36===t(e.width),c.style.position="absolute",o=12===t(c.offsetWidth/3),me.removeChild(l),c=null}}function t(e){return Math.round(parseFloat(e))}var r,i,o,s,a,u,l=v.createElement("div"),c=v.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(g,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),s},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),u},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,t,r,i;return null==a&&(e=v.createElement("table"),t=v.createElement("tr"),r=v.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",r.style.height="9px",r.style.display="block",me.appendChild(e).appendChild(t).appendChild(r),i=n.getComputedStyle(t),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===t.offsetHeight,me.removeChild(e)),a}}))}();var Ze=["Webkit","Moz","ms"],et=v.createElement("div").style,tt={};function nt(e){return S.cssProps[e]||tt[e]||(e in et?e:tt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Ze.length;n--;)if((e=Ze[n]+t)in et)return e}(e)||e)}var rt=/^(none|table(?!-c[ea]).+)/,it={position:"absolute",visibility:"hidden",display:"block"},ot={letterSpacing:"0",fontWeight:"400"};function st(e,t,n){var r=fe.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function at(e,t,n,r,i,o){var s="width"===t?1:0,a=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=S.css(e,n+pe[s],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+pe[s],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+pe[s]+"Width",!0,i))):(u+=S.css(e,"padding"+pe[s],!0,i),"padding"!==n?u+=S.css(e,"border"+pe[s]+"Width",!0,i):a+=S.css(e,"border"+pe[s]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-a-.5))||0),u+l}function ut(e,t,n){var r=We(e),i=(!g.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,s=Je(e,t,r),a="offset"+t[0].toUpperCase()+t.slice(1);if(Ke.test(s)){if(!n)return s;s="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&C(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+at(e,t,n||(i?"border":"content"),o,r,s)+"px"}function lt(e,t,n,r,i){return new lt.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=ie(t),u=$e.test(t),l=e.style;
vendor: 9,142 bytes, line 1
1if(u||(t=nt(a)),s=S.cssHooks[t]||S.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=fe.exec(n))&&i[1]&&(n=ve(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,s,a=ie(t);return $e.test(t)||(t=nt(a)),(s=S.cssHooks[t]||S.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Je(e,t,r)),"normal"===i&&t in ot&&(i=ot[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!rt.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ut(e,t,r):Qe(e,it,function(){return ut(e,t,r)})},set:function(e,n,r){var i,o=We(e),s=!g.scrollboxSize()&&"absolute"===o.position,a=(s||r)&&"border-box"===S.css(e,"boxSizing",!1,o),u=r?at(e,t,r,a,o):0;return a&&s&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-at(e,t,"border",!1,o)-.5)),u&&(i=fe.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),st(0,n,u)}}}),S.cssHooks.marginLeft=Xe(g.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-Qe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+pe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(S.cssHooks[e+t].set=st)}),S.fn.extend({css:function(e,t){return ee(this,function(e,t,n){var r,i,o={},s=0;if(Array.isArray(t)){for(r=We(e),i=t.length;s<i;s++)o[t[s]]=S.css(e,t[s],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=lt).prototype={constructor:lt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=lt.propHooks[this.prop];return e&&e.get?e.get(this):lt.propHooks._default.get(this)},run:function(e){var t,n=lt.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):lt.propHooks._default.set(this),this}}).init.prototype=lt.prototype,(lt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[nt(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=lt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=lt.prototype.init,S.fx.step={};var ct,ht,dt,ft,pt=/^(?:toggle|show|hide)$/,mt=/queueHooks$/;function gt(){ht&&(!1===v.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(gt):n.setTimeout(gt,S.fx.interval),S.fx.tick())}function _t(){return n.setTimeout(function(){ct=void 0}),ct=Date.now()}function yt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=pe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(bt.tweeners[t]||[]).concat(bt.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function bt(e,t,n){var r,i,o=0,s=bt.prefilters.length,a=S.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=ct||_t(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,s=l.tweens.length;o<s;o++)l.tweens[o].run(r);return a.notifyWith(e,[l,r,n]),r<1&&s?n:(s||a.notifyWith(e,[l,1,0]),a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:ct||_t(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(a.notifyWith(e,[l,1,0]),a.resolveWith(e,[l,t])):a.rejectWith(e,[l,t]),this}}),c=l.props;for(function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=ie(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=S.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);o<s;o++)if(r=bt.prefilters[o].call(l,e,c,l.opts))return _(r.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return S.map(c,vt,l),_(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(bt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ve(n.elem,e,fe.exec(t),n),n}]},tweener:function(e,t){_(e)?(t=e,e=["*"]):e=e.match($);for(var n,r=0,i=e.length;r<i;r++)n=e[r],bt.tweeners[n]=bt.tweeners[n]||[],bt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,s,a,u,l,c,h="width"in t||"height"in t,d=this,f={},p=e.style,m=e.nodeType&&ye(e),g=ae.get(e,"fxshow");for(r in n.queue||(null==(s=S._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,S.queue(e,"fx").length||s.empty.fire()})})),t)if(i=t[r],pt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}f[r]=g&&g[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(f))for(r in h&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(l=g&&g.display)&&(l=ae.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(we([e],!0),l=e.style.display||l,c=S.css(e,"display"),we([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(d.done(function(){p.display=l}),null==l&&(c=p.display,l="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),u=!1,f)u||(g?"hidden"in g&&(m=g.hidden):g=ae.access(e,"fxshow",{display:l}),o&&(g.hidden=!m),m&&we([e],!0),d.done(function(){for(r in m||we([e]),ae.remove(e,"fxshow"),f)S.style(e,r,f[r])})),u=vt(m?g[r]:0,r,d),r in g||(g[r]=u.start,m&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?bt.prefilters.unshift(e):bt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||_(e)&&e,duration:e,easing:n&&t||t&&!_(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){_(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ye).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=S.isEmptyObject(e),o=S.speed(t,n,r),s=function(){var t=bt(this,S.extend({},e),o);(i||ae.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=S.timers,s=ae.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&mt.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||S.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=ae.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=S.timers,s=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),S.each(["toggle","show","hide"],function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(yt(t,!0),e,r,i)}}),S.each({slideDown:yt("show"),slideUp:yt("hide"),slideToggle:yt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(ct=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),ct=void 0}
vendor: 5,346 bytes, line 1
1,S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){ht||(ht=!0,gt())},S.fx.stop=function(){ht=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(e,t){return e=S.fx&&S.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,r){var i=n.setTimeout(t,e);r.stop=function(){n.clearTimeout(i)}})},dt=v.createElement("input"),ft=v.createElement("select").appendChild(v.createElement("option")),dt.type="checkbox",g.checkOn=""!==dt.value,g.optSelected=ft.selected,(dt=v.createElement("input")).value="t",dt.type="radio",g.radioValue="t"===dt.value;var wt,It=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return ee(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?wt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match($);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),wt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=It[t]||S.find.attr;It[t]=function(e,t,r){var i,o,s=t.toLowerCase();return r||(o=It[s],It[s]=i,i=null!=n(e,t,r)?s:null,It[s]=o),i}});var Tt=/^(?:input|select|textarea|button)$/i,Et=/^(?:a|area)$/i;function St(e){return(e.match($)||[]).join(" ")}function At(e){return e.getAttribute&&e.getAttribute("class")||""}function Ct(e){return Array.isArray(e)?e:"string"==typeof e&&e.match($)||[]}S.fn.extend({prop:function(e,t){return ee(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):Tt.test(e.nodeName)||Et.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(e){var t,n,r,i,o,s;return _(e)?this.each(function(t){S(this).addClass(e.call(this,t,At(this)))}):(t=Ct(e)).length?this.each(function(){if(r=At(this),n=1===this.nodeType&&" "+St(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");s=St(n),r!==s&&this.setAttribute("class",s)}}):this},removeClass:function(e){var t,n,r,i,o,s;return _(e)?this.each(function(t){S(this).removeClass(e.call(this,t,At(this)))}):arguments.length?(t=Ct(e)).length?this.each(function(){if(r=At(this),n=1===this.nodeType&&" "+St(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];-1<n.indexOf(" "+i+" ");)n=n.replace(" "+i+" "," ");s=St(n),r!==s&&this.setAttribute("class",s)}}):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,s=typeof e,a="string"===s||Array.isArray(e);return _(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,At(this),t),t)}):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=Ct(e),this.each(function(){if(a)for(o=S(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==s||((r=At(this))&&ae.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":ae.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&-1<(" "+St(At(n))+" ").indexOf(t))return!0;return!1}});var kt=/\r/g;S.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=_(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,function(e){return null==e?"":e+""})),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(kt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:St(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],u=s?o+1:i.length;for(r=o<0?u:s?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=S(n).val(),s)return t;a.push(t)}return a}
vendor: 5,070 bytes, line 1
1,set:function(e,t){for(var n,r,i=e.options,o=S.makeArray(t),s=i.length;s--;)((r=i[s]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},g.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var xt=n.location,Nt={guid:Date.now()},Dt=/\?/;S.parseXML=function(e){var t,r;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){}return r=t&&t.getElementsByTagName("parsererror")[0],t&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ot=/^(?:focusinfocus|focusoutblur)$/,Rt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,r,i){var o,s,a,u,l,c,h,d,p=[r||v],m=f.call(e,"type")?e.type:e,g=f.call(e,"namespace")?e.namespace.split("."):[];if(s=d=a=r=r||v,3!==r.nodeType&&8!==r.nodeType&&!Ot.test(m+S.event.triggered)&&(-1<m.indexOf(".")&&(m=(g=m.split(".")).shift(),g.sort()),l=m.indexOf(":")<0&&"on"+m,(e=e[S.expando]?e:new S.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:S.makeArray(t,[e]),h=S.event.special[m]||{},i||!h.trigger||!1!==h.trigger.apply(r,t))){if(!i&&!h.noBubble&&!y(r)){for(u=h.delegateType||m,Ot.test(u+m)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(r.ownerDocument||v)&&p.push(a.defaultView||a.parentWindow||n)}for(o=0;(s=p[o++])&&!e.isPropagationStopped();)d=s,e.type=1<o?u:h.bindType||m,(c=(ae.get(s,"events")||Object.create(null))[e.type]&&ae.get(s,"handle"))&&c.apply(s,t),(c=l&&s[l])&&c.apply&&oe(s)&&(e.result=c.apply(s,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(p.pop(),t)||!oe(r)||l&&_(r[m])&&!y(r)&&((a=r[l])&&(r[l]=null),S.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,Rt),r[m](),e.isPropagationStopped()&&d.removeEventListener(m,Rt),S.event.triggered=void 0,a&&(r[l]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}});var Pt=/\[\]$/,Lt=/\r?\n/g,jt=/^(?:submit|button|image|reset|file)$/i,qt=/^(?:input|select|textarea|keygen)/i;function Mt(e,t,n,r){var i;if(Array.isArray(t))S.each(t,function(t,i){n||Pt.test(e)?r(e,i):Mt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==I(t))r(e,t);else for(i in t)Mt(e+"["+i+"]",t[i],n,r)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=_(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Mt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&qt.test(this.nodeName)&&!jt.test(e)&&(this.checked||!Ee.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Ft=/%20/g,Ut=/#.*$/,zt=/([?&])_=[^&]*/,Vt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Bt=/^(?:GET|HEAD)$/,Gt=/^\/\//,Ht={},Kt={},$t="*/".concat("*"),Wt=v.createElement("a");function Qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match($)||[];if(_(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Yt(e,t,n,r){var i={},o=e===Kt;function s(a){var u;return i[a]=!0,S.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function Jt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=xt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(xt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML}
vendor: 5,143 bytes, line 1
1,flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Jt(Jt(e,S.ajaxSettings),t):Jt(S.ajaxSettings,e)},ajaxPrefilter:Qt(Ht),ajaxTransport:Qt(Kt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,s,a,u,l,c,h,d,f=S.ajaxSetup({},t),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?S(p):S.event,g=S.Deferred(),_=S.Callbacks("once memory"),y=f.statusCode||{},b={},w={},I="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(l){if(!s)for(s={};t=Vt.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==l&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)T.always(e[T.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||I;return r&&r.abort(t),E(0,t),this}};if(g.promise(T),f.url=((e||f.url||xt.href)+"").replace(Gt,xt.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match($)||[""],null==f.crossDomain){u=v.createElement("a");try{u.href=f.url,u.href=u.href,f.crossDomain=Wt.protocol+"//"+Wt.host!=u.protocol+"//"+u.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=S.param(f.data,f.traditional)),Yt(Ht,f,t,T),l)return T;for(h in(c=S.event&&f.global)&&0==S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Bt.test(f.type),i=f.url.replace(Ut,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Ft,"+")):(d=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(Dt.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(zt,"$1"),d=(Dt.test(i)?"&":"?")+"_="+Nt.guid+++d),f.url=i+d),f.ifModified&&(S.lastModified[i]&&T.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&T.setRequestHeader("If-None-Match",S.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&T.setRequestHeader("Content-Type",f.contentType),T.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+$t+"; q=0.01":""):f.accepts["*"]),f.headers)T.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(p,T,f)||l))return T.abort();if(I="abort",_.add(f.complete),T.done(f.success),T.fail(f.error),r=Yt(Kt,f,t,T)){if(T.readyState=1,c&&m.trigger("ajaxSend",[T,f]),l)return T;f.async&&0<f.timeout&&(a=n.setTimeout(function(){T.abort("timeout")},f.timeout));try{l=!1,r.send(b,E)}catch(e){if(l)throw e;E(-1,e)}}else E(-1,"No Transport");function E(e,t,s,u){var h,d,v,b,w,I=t;l||(l=!0,a&&n.clearTimeout(a),r=void 0,o=u||"",T.readyState=0<e?4:0,h=200<=e&&e<300||304===e,s&&(b=function(e,t,n){for(var r,i,o,s,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==u[0]&&u.unshift(o),n[o]}(f,T,s)),!h&&-1<S.inArray("script",f.dataTypes)&&S.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(i in l)if((a=i.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[i]:!0!==l[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(f,b,T,h),h?(f.ifModified&&((w=T.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=w),(w=T.getResponseHeader("etag"))&&(S.etag[i]=w)),204===e||"HEAD"===f.type?I="nocontent":304===e?I="notmodified":(I=b.state,d=b.data,h=!(v=b.error))):(v=I,!e&&I||(I="error",e<0&&(e=0))),T.status=e,T.statusText=(t||I)+"",h?g.resolveWith(p,[d,I,T]):g.rejectWith(p,[T,I,v]),T.statusCode(y),y=void 0,c&&m.trigger(h?"ajaxSuccess":"ajaxError",[T,f,h?d:v]),_.fireWith(p,[T,I]),c&&(m.trigger("ajaxComplete",[T,f]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,t){S[t]=function(e,n,r,i){return _(n)&&(i=i||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:n,success:r},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}}
vendor: 4,845 bytes, line 1
1,dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(_(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return _(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=_(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Xt={0:200,1223:204},Zt=S.ajaxSettings.xhr();g.cors=!!Zt&&"withCredentials"in Zt,g.ajax=Zt=!!Zt,S.ajaxTransport(function(e){var t,r;if(g.cors||Zt&&!e.crossDomain)return{send:function(i,o){var s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];for(s in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);t=function(e){return function(){t&&(t=r=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Xt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),r=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(i){if(t)throw i}},abort:function(){t&&t()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),v.head.appendChild(t[0])},abort:function(){n&&n()}}});var en,tn=[],nn=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tn.pop()||S.expando+"_"+Nt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,s,a=!1!==e.jsonp&&(nn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=_(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(nn,"$1"+i):!1!==e.jsonp&&(e.url+=(Dt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return s||S.error(i+" was not called"),s[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){s=arguments},r.always(function(){void 0===o?S(n).removeProp(i):n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,tn.push(i)),s&&_(o)&&o(s[0]),s=o=void 0}),"script"}),g.createHTMLDocument=((en=v.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===en.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(g.createHTMLDocument?((r=(t=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,t.head.appendChild(r)):t=v),o=!n&&[],(i=U.exec(e))?[t.createElement(i[1])]:(i=De([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,s=this,a=e.indexOf(" ");return-1<a&&(r=St(e.slice(a)),e=e.slice(0,a)),_(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<s.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l=S.css(e,"position"),c=S(e),h={};"static"===l&&(e.style.position="relative"),a=c.offset(),o=S.css(e,"to
1p"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),_(t)&&(t=t.call(e,n,S.extend({},a))),null!=t.top&&(h.top=t.top-a.top+s),null!=t.left&&(h.left=t.left-a.left+i),"using"in t?t.using.call(e,h):c.css(h)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||me})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return ee(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=Xe(g.pixelPosition,function(e,n){if(n)return n=Je(e,t),Ke.test(n)?S(e).position()[t]+"px":n})}),S.each({Height:"height",Width:"width"},function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){S.fn[r]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return ee(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?S.css(t,n,a):S.style(t,n,i,a)},t,s?i:void 0,s)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){S.fn[t]=function(e,n){return 0<arguments.length?this.on(t,null,e,n):this.trigger(t)}});var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),_(e))return r=a.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(a.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=C,S.isFunction=_,S.isWindow=y,S.camelCase=ie,S.type=I,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(rn,"$1")},void 0===(r=function(){return S}.apply(t,[]))||(e.exports=r);var on=n.jQuery,sn=n.$;return S.noConflict=function(e){return n.$===S&&(n.$=sn),e&&n.jQuery===S&&(n.jQuery=on),S},void 0===i&&(n.jQuery=n.$=S),S})},17:function(e,t,n){"use strict";n.r(t),n.d(t,"ActionCodeOperation",function(){return r.b}),n.d(t,"ActionCodeURL",function(){return r.hb}),n.d(t,"AuthCredential",function(){return r.m}),n.d(t,"AuthErrorCodes",function(){return r.j}),n.d(t,"EmailAuthCredential",function(){return r.n}),n.d(t,"EmailAuthProvider",function(){return r.w}),n.d(t,"FacebookAuthProvider",function(){return r.x}),n.d(t,"FactorId",function(){return r.g}),n.d(t,"GithubAuthProvider",function(){return r.z}),n.d(t,"GoogleAuthProvider",function(){return r.y}),n.d(t,"OAuthCredential",function(){return r.o}),n.d(t,"OAuthProvider",function(){return r.A}),n.d(t,"OperationType",function(){return r.p}),n.d(t,"PhoneAuthCredential",function(){return r.r}),n.d(t,"PhoneAuthProvider",function(){return r.q}),n.d(t,"PhoneMultiFactorGenerator",function(){return r.Kb}
1),n.d(t,"ProviderId",function(){return r.Nb}),n.d(t,"RecaptchaVerifier",function(){return r.s}),n.d(t,"SAMLAuthProvider",function(){return r.B}),n.d(t,"SignInMethod",function(){return r.t}),n.d(t,"TotpMultiFactorGenerator",function(){return r.u}),n.d(t,"TotpSecret",function(){return r.Lb}),n.d(t,"TwitterAuthProvider",function(){return r.a}),n.d(t,"applyActionCode",function(){return r.K}),n.d(t,"beforeAuthStateChanged",function(){return r.Vb}),n.d(t,"browserLocalPersistence",function(){return r.zb}),n.d(t,"browserPopupRedirectResolver",function(){return r.Ib}),n.d(t,"browserSessionPersistence",function(){return r.C}),n.d(t,"checkActionCode",function(){return r.L}),n.d(t,"confirmPasswordReset",function(){return r.J}),n.d(t,"connectAuthEmulator",function(){return r.l}),n.d(t,"createUserWithEmailAndPassword",function(){return r.Z}),n.d(t,"debugErrorMap",function(){return r.h}),n.d(t,"deleteUser",function(){return r.f}),n.d(t,"fetchSignInMethodsForEmail",function(){return r.eb}),n.d(t,"getAdditionalUserInfo",function(){return r.pb}),n.d(t,"getAuth",function(){return r.Mb}),n.d(t,"getIdToken",function(){return r.mb}),n.d(t,"getIdTokenResult",function(){return r.nb}),n.d(t,"getMultiFactorResolver",function(){return r.rb}),n.d(t,"getRedirectResult",function(){return r.Hb}),n.d(t,"inMemoryPersistence",function(){return r.v}),n.d(t,"indexedDBLocalPersistence",function(){return r.Gb}),n.d(t,"initializeAuth",function(){return r.k}),n.d(t,"initializeRecaptchaConfig",function(){return r.Rb}),n.d(t,"isSignInWithEmailLink",function(){return r.cb}),n.d(t,"linkWithCredential",function(){return r.F}),n.d(t,"linkWithPhoneNumber",function(){return r.Jb}),n.d(t,"linkWithPopup",function(){return r.Bb}),n.d(t,"linkWithRedirect",function(){return r.Eb}),n.d(t,"multiFactor",function(){return r.sb}),n.d(t,"onAuthStateChanged",function(){return r.Wb}),n.d(t,"onIdTokenChanged",function(){return r.Ub}),n.d(t,"parseActionCodeURL",function(){return r.ib}),n.d(t,"prodErrorMap",function(){return r.i}),n.d(t,"reauthenticateWithCredential",function(){return r.G}),n.d(t,"reauthenticateWithPhoneNumber",function(){return r.Pb}),n.d(t,"reauthenticateWithPopup",function(){return r.Cb}),n.d(t,"reauthenticateWithRedirect",function(){return r.Fb}),n.d(t,"reload",function(){return r.qb}),n.d(t,"revokeAccessToken",function(){return r.e}),n.d(t,"sendEmailVerification",function(){return r.fb}),n.d(t,"sendPasswordResetEmail",function(){return r.I}),n.d(t,"sendSignInLinkToEmail",function(){return r.bb}),n.d(t,"setPersistence",function(){return r.Ob}),n.d(t,"signInAnonymously",function(){return r.D}),n.d(t,"signInWithCredential",function(){return r.E}),n.d(t,"signInWithCustomToken",function(){return r.H}),n.d(t,"signInWithEmailAndPassword",function(){return r.ab}),n.d(t,"signInWithEmailLink",function(){return r.db}),n.d(t,"signInWithPhoneNumber",function(){return r.Qb}),n.d(t,"signInWithPopup",function(){return r.Ab}),n.d(t,"signInWithRedirect",function(){return r.Db}),n.d(t,"signOut",function(){return r.d}),n.d(t,"unlink",function(){return r.ob}),n.d(t,"updateCurrentUser",function(){return r.c}),n.d(t,"updateEmail",function(){return r.kb}),n.d(t,"updatePassword",function(){return r.lb}),n.d(t,"updatePhoneNumber",function(){return r.Sb}),n.d(t,"updateProfile",function(){return r.jb}),n.d(t,"useDeviceLanguage",function(){return r.Xb}),n.d(t,"validatePassword",function(){return r.Tb}),n.d(t,"verifyBeforeUpdateEmail",function(){return r.gb}),n.d(t,"verifyPasswordResetCode",function(){return r.M});var r=n(0);n(3),n(1),n(6),n(7)},18:function(e,t,n){"use strict";n.r(t);var r=n(23);n.d(t,"AbstractUserDataWriter",function(){return r.a}),n.d(t,"AggregateField",function(){return r.b}),n.d(t,"AggregateQuerySnapshot",function(){return r.c}),n.d(t,"Bytes",function(){return r.d}),n.d(t,"CACHE_SIZE_UNLIMITED",function(){return r.e}),n.d(t,"CollectionReference",function(){return r.f}),n.d(t,"DocumentReference",function(){return r.g}),n.d(t,"DocumentSnapshot",function(){return r.h}),n.d(t,"FieldPath",function(){return r.i}),n.d(t,"FieldValue",function(){return r.j}),n.d(t,"Firestore",function(){return r.k}),n.d(t,"FirestoreError",function(){return r.l}),n.d(t,"GeoPoint",function(){return r.m}),n.d(t,"LoadBundleTask",function(){return r.n}),n.d(t,"PersistentCacheIndexManager",function(){return r.o}),n.d(t,"Query",function(){return r.p}),n.d(t,"QueryCompositeFilterConstraint",function(){return r.q}),n.d(t,"QueryConstraint",function(){return r.r}),n.d(t,"QueryDocumentSnapshot",function(){return r.s}),n.d(t,"QueryEndAtConstraint",function(){return r.t}),n.d(t,"QueryFieldFilterConstraint",function(){return r.u}),n.d(t,"QueryLimitConstraint",function(){return r.v}),n.d(t,"QueryOrderByConstraint",function(){return r.w}
1),n.d(t,"QuerySnapshot",function(){return r.x}),n.d(t,"QueryStartAtConstraint",function(){return r.y}),n.d(t,"SnapshotMetadata",function(){return r.z}),n.d(t,"Timestamp",function(){return r.A}),n.d(t,"Transaction",function(){return r.B}),n.d(t,"WriteBatch",function(){return r.C}),n.d(t,"_AutoId",function(){return r.D}),n.d(t,"_ByteString",function(){return r.E}),n.d(t,"_DatabaseId",function(){return r.F}),n.d(t,"_DocumentKey",function(){return r.G}),n.d(t,"_EmptyAppCheckTokenProvider",function(){return r.H}),n.d(t,"_EmptyAuthCredentialsProvider",function(){return r.I}),n.d(t,"_FieldPath",function(){return r.J}),n.d(t,"_TestingHooks",function(){return r.K}),n.d(t,"_cast",function(){return r.L}),n.d(t,"_debugAssert",function(){return r.M}),n.d(t,"_internalAggregationQueryToProtoRunAggregationQueryRequest",function(){return r.N}),n.d(t,"_internalQueryToProtoQueryTarget",function(){return r.O}),n.d(t,"_isBase64Available",function(){return r.P}),n.d(t,"_logWarn",function(){return r.Q}),n.d(t,"_validateIsNotUsedTogether",function(){return r.R}),n.d(t,"addDoc",function(){return r.S}),n.d(t,"aggregateFieldEqual",function(){return r.T}),n.d(t,"aggregateQuerySnapshotEqual",function(){return r.U}),n.d(t,"and",function(){return r.V}),n.d(t,"arrayRemove",function(){return r.W}),n.d(t,"arrayUnion",function(){return r.X}),n.d(t,"average",function(){return r.Y}),n.d(t,"clearIndexedDbPersistence",function(){return r.Z}),n.d(t,"collection",function(){return r.ab}),n.d(t,"collectionGroup",function(){return r.bb}),n.d(t,"connectFirestoreEmulator",function(){return r.cb}),n.d(t,"count",function(){return r.db}),n.d(t,"deleteAllPersistentCacheIndexes",function(){return r.eb}),n.d(t,"deleteDoc",function(){return r.fb}),n.d(t,"deleteField",function(){return r.gb}),n.d(t,"disableNetwork",function(){return r.hb}),n.d(t,"disablePersistentCacheIndexAutoCreation",function(){return r.ib}),n.d(t,"doc",function(){return r.jb}),n.d(t,"documentId",function(){return r.kb}),n.d(t,"enableIndexedDbPersistence",function(){return r.lb}),n.d(t,"enableMultiTabIndexedDbPersistence",function(){return r.mb}),n.d(t,"enableNetwork",function(){return r.nb}),n.d(t,"enablePersistentCacheIndexAutoCreation",function(){return r.ob}),n.d(t,"endAt",function(){return r.pb}),n.d(t,"endBefore",function(){return r.qb}),n.d(t,"ensureFirestoreConfigured",function(){return r.rb}),n.d(t,"executeWrite",function(){return r.sb}),n.d(t,"getAggregateFromServer",function(){return r.tb}),n.d(t,"getCountFromServer",function(){return r.ub}),n.d(t,"getDoc",function(){return r.vb}),n.d(t,"getDocFromCache",function(){return r.wb}),n.d(t,"getDocFromServer",function(){return r.xb}),n.d(t,"getDocs",function(){return r.yb}),n.d(t,"getDocsFromCache",function(){return r.zb}),n.d(t,"getDocsFromServer",function(){return r.Ab}),n.d(t,"getFirestore",function(){return r.Bb}),n.d(t,"getPersistentCacheIndexManager",function(){return r.Cb}),n.d(t,"increment",function(){return r.Db}),n.d(t,"initializeFirestore",function(){return r.Eb}),n.d(t,"limit",function(){return r.Fb}),n.d(t,"limitToLast",function(){return r.Gb}),n.d(t,"loadBundle",function(){return r.Hb}),n.d(t,"memoryEagerGarbageCollector",function(){return r.Ib}),n.d(t,"memoryLocalCache",function(){return r.Jb}),n.d(t,"memoryLruGarbageCollector",function(){return r.Kb}),n.d(t,"namedQuery",function(){return r.Lb}),n.d(t,"onSnapshot",function(){return r.Mb}),n.d(t,"onSnapshotsInSync",function(){return r.Nb}),n.d(t,"or",function(){return r.Ob}),n.d(t,"orderBy",function(){return r.Pb}),n.d(t,"persistentLocalCache",function(){return r.Qb}),n.d(t,"persistentMultipleTabManager",function(){return r.Rb}),n.d(t,"persistentSingleTabManager",function(){return r.Sb}),n.d(t,"query",function(){return r.Tb}),n.d(t,"queryEqual",function(){return r.Ub}),n.d(t,"refEqual",function(){return r.Vb}),n.d(t,"runTransaction",function(){return r.Wb}),n.d(t,"serverTimestamp",function(){return r.Xb}),n.d(t,"setDoc",function(){return r.Yb}),n.d(t,"setIndexConfiguration",function(){return r.Zb}),n.d(t,"setLogLevel",function(){return r.ac}),n.d(t,"snapshotEqual",function(){return r.bc}),n.d(t,"startAfter",function(){return r.cc}),n.d(t,"startAt",function(){return r.dc}),n.d(t,"sum",function(){return r.ec}),n.d(t,"terminate",function(){return r.fc}),n.d(t,"updateDoc",function(){return r.gc}),n.d(t,"waitForPendingWrites",function(){return r.hc}),n.d(t,"where",function(){return r.ic}),n.d(t,"writeBatch",function(){return r.jc})},19:function(e,t,n){var r,i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r=[n(12)],void 0===(i=function(e){var t=e.firebase.routes;return{getSubscriptions:function(e){var n=t.backend.user.subscriptions;return fetch(n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(e){return e.json().then(function(t){return 200!==e.status?Promise.reject("Error fetching subscriptions for user}"):"object"!==o(t)?Promise.reject("Unexpected response fetching subscriptions for user"):t})})},getSubscriptionId:function(e){var n=t.backend.subscriptions.find;return fetch(n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({by:"slug",value:e})}).then(function(t){return t.json().then(function(n){return 200!==t.status?Promise.reject("Error fetching subscription id for ".concat(e)):"object"===o(n)&&n.id?n.id:Promise.reject("Unexpected response fetching subscription id for ".concat(e))})})},subscribeAndUnSubscribe:function(e){return fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(e){return e.json().then(function(t){return 200===e.status?t:Promise.reject(t)})}).then(function(e){return e}).catch(function(e){return Promise.reject(e)})}}}.apply(t,r))||(e.exports=i)},20:function(e,t,n){var r,i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r=[n(12),n(15)],void 0===(i=function(e,t){var n=e.firebase.routes;return{getFavorites:function(e){var t="".concat(n.backend.user.favorites,"?page=").concat(e);return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(e){return e.json().then(function(t){return 200!==e.status?Promise.reject("Error fetching favorites for user"):"object"!==o(t)?Promise.reject("Unexpected response fetching favorites for user"):t})})},getFavoriteId:function(e){return fetch(n.backend.favorites.find,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({by:"slug",value:e})}).then(function(t){return t.json().then(function(n){return 200!==t.status?Promise.reject("Error fetching favorite id for ".concat(e)):"object"===o(n)&&n.id?n.id:Promise.reject("Unexpected response fetching favorite id for ".concat(e))})})}}}.apply(t,r))||(e.exports=i)},21:function(e,t,n){e.exports=function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}return function t(n,r){function i(t,i,o){if("undefined"!=typeof document){"number"==typeof(o=e({},r,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decode
1URIComponent).replace(/[()]/g,escape);var s="";for(var a in o)o[a]&&(s+="; "+a,!0!==o[a]&&(s+="="+o[a].split(";")[0]));return document.cookie=t+"="+n.write(i,t)+s}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],r={},i=0;i<t.length;i++){var o=t[i].split("="),s=o.slice(1).join("=");try{var a=decodeURIComponent(o[0]);if(r[a]=n.read(s,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(t,n){i(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},22:function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,l=[],c=!1,h=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&f())}function f(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++h<t;)u&&u[h].run();h=-1,t=l.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||c||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},223:function(e,t,n){var r,i;r=[n(17),n(26)],void 0===(i=function(e,t){function n(){try{var n=t.getAuth();e.onAuthStateChanged(n,r,function(e){console.log(e)})}catch(e){console.error(e.message)}}function r(e){e&&t.isMenuRoute()&&t.getProfileData(e).then(function(e){e.onboarding_completed||t.redirectToOnboardingRoute(1)})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n):n()}.apply(t,r))||(e.exports=i)},23:function(e,t,n){"use strict";(function(e,r){n.d(t,"a",function(){return hh}),n.d(t,"b",function(){return ic}),n.d(t,"c",function(){return oc}),n.d(t,"d",function(){return sc}),n.d(t,"e",function(){return zl}),n.d(t,"f",function(){return Ol}),n.d(t,"g",function(){return Dl}),n.d(t,"h",function(){return bh}),n.d(t,"i",function(){return ac}),n.d(t,"j",function(){return lc}),n.d(t,"k",function(){return Vl}),n.d(t,"l",function(){return S}),n.d(t,"m",function(){return cc}),n.d(t,"n",function(){return Ul}),n.d(t,"o",function(){return fd}),n.d(t,"p",function(){return Nl}),n.d(t,"q",function(){return Kc}),n.d(t,"r",function(){return Vc}),n.d(t,"s",function(){return wh}),n.d(t,"t",function(){return rh}),n.d(t,"u",function(){return Gc}),n.d(t,"v",function(){return Jc}),n.d(t,"w",function(){return Qc}),n.d(t,"x",function(){return Ih}),n.d(t,"y",function(){return eh}),n.d(t,"z",function(){return vh}),n.d(t,"A",function(){return z}),n.d(t,"B",function(){return rd}),n.d(t,"C",function(){return td}),n.d(t,"D",function(){return q}),n.d(t,"E",function(){return pt}),n.d(t,"F",function(){return Tt}),n.d(t,"G",function(){return $}),n.d(t,"H",function(){return L}),n.d(t,"I",function(){return k}),n.d(t,"J",function(){return K}),n.d(t,"K",function(){return Id}),n.d(t,"L",function(){return Sl}),n.d(t,"M",function(){return I}),n.d(t,"N",function(){return wd}),n.d(t,"O",function(){return bd}),n.d(t,"P",function(){return ft}),n.d(t,"Q",function(){return y}),n.d(t,"R",function(){return wl}),n.d(t,"S",function(){return Lh}),n.d(t,"T",function(){return _h}),n.d(t,"U",function(){return yh}),n.d(t,"V",function(){return Wc}),n.d(t,"W",function(){return ud}),n.d(t,"X",function(){return ad}),n.d(t,"Y",function(){return mh}),n.d(t,"Z",function(){return Yl}),n.d(t,"ab",function(){return Rl}),n.d(t,"bb",function(){return Pl}),n.d(t,"cb",function(){return xl}),n.d(t,"db",function(){return gh}),n.d(t,"eb",function(){return _d}),n.d(t,"fb",function(){return Ph}),n.d(t,"gb",function(){return od}),n.d(t,"hb",function(){return Zl}),n.d(t,"ib",function(){return gd}),n.d(t,"jb",function(){return Ll}),n.d(t,"kb",function(){return uc}),n.d(t,"lb",function(){return $l}),n.d(t,"mb",function(){return Wl}),n.d(t,"nb",function(){return Xl}),n.d(t,"ob",function(){return md}),n.d(t,"pb",function(){return oh}),n.d(t,"qb",function(){return ih}),n.d(t,"rb",function(){return Hl}),n.d(t,"sb",function(){return Mh}),n.d(t,"tb",function(){return zh}),n.d(t,"ub",function(){return Uh}),n.d(t,"vb",function(){return Sh}),n.d(t,"wb",function(){return Ch}),n.d(t,"xb",function(){return kh}),n.d(t,"yb",function(){return xh}),n.d(t,"zb",function(){return Nh}),n.d(t,"Ab",function(){return Dh}),n.d(t,"Bb",function(){return Gl}),n.d(t,"Cb",function(){return pd}),n.d(t,"Db",function(){return ld}),n.d(t,"Eb",function(){return Bl}),n.d(t,"Fb",function(){return Xc}),n.d(t,"Gb",function(){return Zc}),n.d(t,"Hb",function(){return tc}),n.d(t,"Ib",function(){return Kh}),n.d(t,"Jb",function(){return Wh}),n.d(t,"Kb",function(){return $h}),n.d(t,"Lb",function(){return nc}),n.d(t,"Mb",function(){return jh}),n.d(t,"Nb",function(){return qh}),n.d(t,"Ob",function(){return $c}),n.d(t,"Pb",function(){return Yc}),n.d(t,"Qb",function(){return Qh}),n.d(t,"Rb",function(){return Zh}),n.d(t,"Sb",function(){return Xh}),n.d(t,"Tb",function(){return Bc}),n.d(t,"Ub",function(){return ql}),n.d(t,"Vb",function(){return jl}),n.d(t,"Wb",function(){return id}),n.d(t,"Xb",function(){return sd}),n.d(t,"Yb",function(){return Oh}),n.d(t,"Zb",function(){return hd}),n.d(t,"ac",function(){return m}),n.d(t,"bc",function(){return Eh}),n.d(t,"cc",function(){return nh}),n.d(t,"dc",function(){return th}),n.d(t,"ec",function(){return ph}),n.d(t,"fc",function(){return ec}),n.d(t,"gc",function(){return Rh}),n.d(t,"hc",function(){return Jl}),n.d(t,"ic",function(){return Hc}),n.d(t,"jc",function(){return cd});var i=n(3),o=n(7),s=n(6),a=n(1),u=n(9),l=n(8);const c="@firebase/firestore";class h{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}h.UNAUTHENTICATED=new h(null),h.GOOGLE_CREDENTIALS=new h("google-credentials-uid"),h.FIRST_PARTY=new h("first-party-uid"),h.MOCK_USER=new h("mock-user");let d="10.12.1";const f=new s.b("@firebase/firestore");function p(){return f.logLevel}function m(e){f.setLogLevel(e)}function g(e,...t){if(f.logLevel<=s.a.DEBUG){const n=t.map(v);f.debug(`Firestore (${d}): ${e}`,...n)}}function _(e,...t){if(f.logLevel<=s.a.ERROR){const n=t.map(v);f.error(`Firestore (${d}): ${e}`,...n)}}function y(e,...t){if(f.logLevel<=s.a.WARN){const n=t.map(v);f.warn(`Firestore (${d}): ${e}`,...n)}}function v(e){if("string"==typeof e)return e;try{return function(e){return JSON.stringify(e)}(e)}catch(t){return e}}function b(e="Unexpected state"){const t=`FIRESTORE (${d}) INTERNAL ASSERTION FAILED: `+e;throw _(t),new Error(t)}function w(e,t){e||b()}function I(e,t){e||b()}function T(e,t){return e}const E={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENT
1ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class S extends a.c{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class A{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class C{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization","Bearer "+e)}}class k{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(h.UNAUTHENTICATED))}shutdown(){}}class x{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class N{constructor(e){this.t=e,this.currentUser=h.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){let n=this.i;const r=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve();let i=new A;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new A,e.enqueueRetryable(()=>r(this.currentUser))};const o=()=>{const t=i;e.enqueueRetryable(async()=>{await t.promise,await r(this.currentUser)})},s=e=>{g("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.auth.addAuthTokenListener(this.o),o()};this.t.onInit(e=>s(e)),setTimeout(()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?s(e):(g("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new A)}},0),o()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(g("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(w("string"==typeof t.accessToken),new C(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return w(null===e||"string"==typeof e),new h(e)}}class D{constructor(e,t,n){this.l=e,this.h=t,this.P=n,this.type="FirstParty",this.user=h.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class O{constructor(e,t,n){this.l=e,this.h=t,this.P=n}getToken(){return Promise.resolve(new D(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(h.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class R{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class P{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,t){const n=e=>{null!=e.error&&g("FirebaseAppCheckTokenProvider","Error getting App Check token; using placeholder token instead. Error: "+e.error.message);const n=e.token!==this.R;return this.R=e.token,g("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>n(t))};const r=e=>{g("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.appCheck.addTokenListener(this.o)};this.A.onInit(e=>r(e)),setTimeout(()=>{if(!this.appCheck){const e=this.A.getImmediate({optional:!0});e?r(e):g("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(w("string"==typeof e.token),this.R=e.token,new R(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}class L{getToken(){return Promise.resolve(new R(""))}invalidateToken(){}start(e,t){}shutdown(){}}function j(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let t=0;t<e;t++)n[t]=Math.floor(256*Math.random());return n}class q{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(256/62);let n="";for(;n.length<20;){const r=j(40);for(let i=0;i<r.length;++i)n.length<20&&r[i]<t&&(n+=e.charAt(r[i]%62))}return n}}function M(e,t){return e<t?-1:e>t?1:0}function F(e,t,n){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function U(e){return e+"\0"}class z{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new S(E.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new S(E.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new S(E.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new S(E.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return z.fromMillis(Date.now())}static fromDate(e){return z.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*t));return new z(t,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?M(this.nanoseconds,e.nanoseconds):M(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
1}class V{constructor(e){this.timestamp=e}static fromTimestamp(e){return new V(e)}static min(){return new V(new z(0,0))}static max(){return new V(new z(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class B{constructor(e,t,n){void 0===t?t=0:t>e.length&&b(),void 0===n?n=e.length-t:n>e.length-t&&b(),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===B.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof B?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++){const n=e.get(r),i=t.get(r);if(n<i)return-1;if(n>i)return 1}return e.length<t.length?-1:e.length>t.length?1:0}}class G extends B{construct(e,t,n){return new G(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new S(E.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter(e=>e.length>0))}return new G(t)}static emptyPath(){return new G([])}}const H=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class K extends B{construct(e,t,n){return new K(e,t,n)}static isValidIdentifier(e){return H.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),K.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new K(["__name__"])}static fromServerFormat(e){const t=[];let n="",r=0;const i=()=>{if(0===n.length)throw new S(E.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""};let o=!1;for(;r<e.length;){const t=e[r];if("\\"===t){if(r+1===e.length)throw new S(E.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new S(E.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,r+=2}else"`"===t?(o=!o,r++):"."!==t||o?(n+=t,r++):(i(),r++)}if(i(),o)throw new S(E.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new K(t)}static emptyPath(){return new K([])}}class ${constructor(e){this.path=e}static fromPath(e){return new $(G.fromString(e))}static fromName(e){return new $(G.fromString(e).popFirst(5))}static empty(){return new $(G.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===G.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return G.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new $(new G(e.slice()))}}class W{constructor(e,t,n,r){this.indexId=e,this.collectionGroup=t,this.fields=n,this.indexState=r}}function Q(e){return e.fields.find(e=>2===e.kind)}function Y(e){return e.fields.filter(e=>2!==e.kind)}function J(e,t){let n=M(e.collectionGroup,t.collectionGroup);if(0!==n)return n;for(let r=0;r<Math.min(e.fields.length,t.fields.length);++r)if(n=Z(e.fields[r],t.fields[r]),0!==n)return n;return M(e.fields.length,t.fields.length)}W.UNKNOWN_ID=-1;class X{constructor(e,t){this.fieldPath=e,this.kind=t}}function Z(e,t){const n=K.comparator(e.fieldPath,t.fieldPath);return 0!==n?n:M(e.kind,t.kind)}class ee{constructor(e,t){this.sequenceNumber=e,this.offset=t}static empty(){return new ee(0,re.min())}}function te(e,t){const n=e.toTimestamp().seconds,r=e.toTimestamp().nanoseconds+1,i=V.fromTimestamp(1e9===r?new z(n+1,0):new z(n,r));return new re(i,$.empty(),t)}function ne(e){return new re(e.readTime,e.key,-1)}class re{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new re(V.min(),$.empty(),-1)}static max(){return new re(V.max(),$.empty(),-1)}}function ie(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=$.comparator(e.documentKey,t.documentKey),0!==n?n:M(e.largestBatchId,t.largestBatchId))}const oe="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class se{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}
1raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function ae(e){if(e.code!==E.FAILED_PRECONDITION||e.message!==oe)throw e;g("LocalStore","Unexpectedly lost primary lease")}class ue{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&b(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new ue((n,r)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,r)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,r)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof ue?t:ue.resolve(t)}catch(e){return ue.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):ue.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):ue.reject(t)}static resolve(e){return new ue((t,n)=>{t(e)})}static reject(e){return new ue((t,n)=>{n(e)})}static waitFor(e){return new ue((t,n)=>{let r=0,i=0,o=!1;e.forEach(e=>{++r,e.next(()=>{++i,o&&i===r&&t()},e=>n(e))}),o=!0,i===r&&t()})}static or(e){let t=ue.resolve(!1);for(const n of e)t=t.next(e=>e?ue.resolve(e):n());return t}static forEach(e,t){const n=[];return e.forEach((e,r)=>{n.push(t.call(this,e,r))}),this.waitFor(n)}static mapArray(e,t){return new ue((n,r)=>{const i=e.length,o=new Array(i);let s=0;for(let a=0;a<i;a++){const u=a;t(e[u]).next(e=>{o[u]=e,++s,s===i&&n(o)},e=>r(e))}})}static doWhile(e,t){return new ue((n,r)=>{const i=()=>{!0===e()?t().next(()=>{i()},r):n()};i()})}}class le{constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.V=new A,this.transaction.oncomplete=()=>{this.V.resolve()},this.transaction.onabort=()=>{t.error?this.V.reject(new fe(e,t.error)):this.V.resolve()},this.transaction.onerror=t=>{const n=ye(t.target.error);this.V.reject(new fe(e,n))}}static open(e,t,n,r){try{return new le(t,e.transaction(r,n))}catch(e){throw new fe(t,e)}}get m(){return this.V.promise}abort(e){e&&this.V.reject(e),this.aborted||(g("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}g(){const e=this.transaction;this.aborted||"function"!=typeof e.commit||e.commit()}store(e){const t=this.transaction.objectStore(e);return new me(t)}}class ce{constructor(e,t,n){this.name=e,this.version=t,this.p=n,12.2===ce.S(Object(a.q)())&&_("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(e){return g("SimpleDb","Removing database:",e),ge(window.indexedDB.deleteDatabase(e)).toPromise()}static D(){if(!Object(a.v)())return!1;if(ce.C())return!0;const e=Object(a.q)(),t=ce.S(e),n=0<t&&t<10,r=he(e),i=0<r&&r<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||n||i)}static C(){var t;return void 0!==e&&"YES"===(null===(t=e.__PRIVATE_env)||void 0===t?void 0:t.v)}static F(e,t){return e.store(t)}static S(e){const t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)}async M(e){return this.db||(g("SimpleDb","Opening database:",this.name),this.db=await new Promise((t,n)=>{const r=indexedDB.open(this.name,this.version);r.onsuccess=e=>{const n=e.target.result;t(n)},r.onblocked=()=>{n(new fe(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},r.onerror=t=>{const r=t.target.error;"VersionError"===r.name?n(new S(E.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):"InvalidStateError"===r.name?n(new S(E.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+r)):n(new fe(e,r))},r.onupgradeneeded=e=>{g("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',e.oldVersion);const t=e.target.result;this.p.O(t,r.transaction,e.oldVersion,this.version).next(()=>{g("SimpleDb","Database upgrade to version "+this.version+" complete")}
1)}})),this.N&&(this.db.onversionchange=e=>this.N(e)),this.db}L(e){this.N=e,this.db&&(this.db.onversionchange=t=>e(t))}async runTransaction(e,t,n,r){const i="readonly"===t;let o=0;for(;;){++o;try{this.db=await this.M(e);const t=le.open(this.db,e,i?"readonly":"readwrite",n),o=r(t).next(e=>(t.g(),e)).catch(e=>(t.abort(e),ue.reject(e))).toPromise();return o.catch(()=>{}),await t.m,o}catch(e){const t=e,n="FirebaseError"!==t.name&&o<3;if(g("SimpleDb","Transaction failed with error:",t.message,"Retrying:",n),this.close(),!n)return Promise.reject(t)}}}close(){this.db&&this.db.close(),this.db=void 0}}function he(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}class de{constructor(e){this.B=e,this.k=!1,this.q=null}get isDone(){return this.k}get K(){return this.q}set cursor(e){this.B=e}done(){this.k=!0}$(e){this.q=e}delete(){return ge(this.B.delete())}}class fe extends S{constructor(e,t){super(E.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function pe(e){return"IndexedDbTransactionError"===e.name}class me{constructor(e){this.store=e}put(e,t){let n;return void 0!==t?(g("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(g("SimpleDb","PUT",this.store.name,"<auto-key>",e),n=this.store.put(e)),ge(n)}add(e){return g("SimpleDb","ADD",this.store.name,e,e),ge(this.store.add(e))}get(e){return ge(this.store.get(e)).next(t=>(void 0===t&&(t=null),g("SimpleDb","GET",this.store.name,e,t),t))}delete(e){return g("SimpleDb","DELETE",this.store.name,e),ge(this.store.delete(e))}count(){return g("SimpleDb","COUNT",this.store.name),ge(this.store.count())}U(e,t){const n=this.options(e,t),r=n.index?this.store.index(n.index):this.store;if("function"==typeof r.getAll){const e=r.getAll(n.range);return new ue((t,n)=>{e.onerror=e=>{n(e.target.error)},e.onsuccess=e=>{t(e.target.result)}})}{const e=this.cursor(n),t=[];return this.W(e,(e,n)=>{t.push(n)}).next(()=>t)}}G(e,t){const n=this.store.getAll(e,null===t?void 0:t);return new ue((e,t)=>{n.onerror=e=>{t(e.target.error)},n.onsuccess=t=>{e(t.target.result)}})}j(e,t){g("SimpleDb","DELETE ALL",this.store.name);const n=this.options(e,t);n.H=!1;const r=this.cursor(n);return this.W(r,(e,t,n)=>n.delete())}J(e,t){let n;t?n=e:(n={},t=e);const r=this.cursor(n);return this.W(r,t)}Y(e){const t=this.cursor({});return new ue((n,r)=>{t.onerror=e=>{const t=ye(e.target.error);r(t)},t.onsuccess=t=>{const r=t.target.result;r?e(r.primaryKey,r.value).next(e=>{e?r.continue():n()}):n()}})}W(e,t){const n=[];return new ue((r,i)=>{e.onerror=e=>{i(e.target.error)},e.onsuccess=e=>{const i=e.target.result;if(!i)return void r();const o=new de(i),s=t(i.primaryKey,i.value,o);if(s instanceof ue){const e=s.catch(e=>(o.done(),ue.reject(e)));n.push(e)}o.isDone?r():null===o.K?i.continue():i.continue(o.K)}}).next(()=>ue.waitFor(n))}options(e,t){let n;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){const n=this.store.index(e.index);return e.H?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function ge(e){return new ue((t,n)=>{e.onsuccess=e=>{const n=e.target.result;t(n)},e.onerror=e=>{const t=ye(e.target.error);n(t)}})}let _e=!1;function ye(e){const t=ce.S(Object(a.q)());if(t>=12.2&&t<13){const t="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(t)>=0){const e=new S("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return _e||(_e=!0,setTimeout(()=>{throw e},0)),e}}return e}class ve{constructor(e,t){this.asyncQueue=e,this.Z=t,this.task=null}start(){this.X(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return null!==this.task}X(e){g("IndexBackfiller",`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,async()=>{this.task=null;try{g("IndexBackfiller","Documents written: "+await this.Z.ee())}catch(e){pe(e)?g("IndexBackfiller","Ignoring IndexedDB error during index backfill: ",e):await ae(e)}await this.X(6e4)})}}class be{constructor(e,t){this.localStore=e,this.persistence=t}async ee(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",t=>this.te(t,e))}te(e,t){const n=new Set;let r=t,i=!0;return ue.doWhile(()=>!0===i&&r>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(t=>
1{if(null!==t&&!n.has(t))return g("IndexBackfiller","Processing collection: "+t),this.ne(e,t,r).next(e=>{r-=e,n.add(t)});i=!1})).next(()=>t-r)}ne(e,t,n){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next(r=>this.localStore.localDocuments.getNextDocuments(e,t,r,n).next(n=>{const i=n.changes;return this.localStore.indexManager.updateIndexEntries(e,i).next(()=>this.re(r,n)).next(n=>(g("IndexBackfiller","Updating offset: "+n),this.localStore.indexManager.updateCollectionGroup(e,t,n))).next(()=>i.size)}))}re(e,t){let n=e;return t.changes.forEach((e,t)=>{const r=ne(t);ie(r,n)>0&&(n=r)}),new re(n.readTime,n.documentKey,Math.max(t.batchId,e.largestBatchId))}}class we{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ie(e),this.se=e=>t.writeSequenceNumber(e))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}function Ie(e){return null==e}function Te(e){return 0===e&&1/e==-1/0}function Ee(e){return"number"==typeof e&&Number.isInteger(e)&&!Te(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}function Se(e){let t="";for(let n=0;n<e.length;n++)t.length>0&&(t=Ce(t)),t=Ae(e.get(n),t);return Ce(t)}function Ae(e,t){let n=t;const r=e.length;for(let t=0;t<r;t++){const r=e.charAt(t);switch(r){case"\0":n+="��";break;case"�":n+="��";break;default:n+=r}}return n}function Ce(e){return e+"��"}function ke(e){const t=e.length;if(w(t>=2),2===t)return w("�"===e.charAt(0)&&"�"===e.charAt(1)),G.emptyPath();const n=t-2,r=[];let i="";for(let o=0;o<t;){const t=e.indexOf("�",o);switch((t<0||t>n)&&b(),e.charAt(t+1)){case"�":const n=e.substring(o,t);let s;0===i.length?s=n:(i+=n,s=i,i=""),r.push(s);break;case"�":i+=e.substring(o,t),i+="\0";break;case"�":i+=e.substring(o,t+1);break;default:b()}o=t+2}return new G(r)}we.oe=-1;const xe=["userId","batchId"];function Ne(e,t){return[e,Se(t)]}function De(e,t,n){return[e,Se(t),n]}const Oe={},Re=["prefixPath","collectionGroup","readTime","documentId"],Pe=["prefixPath","collectionGroup","documentId"],Le=["collectionGroup","readTime","prefixPath","documentId"],je=["canonicalId","targetId"],qe=["targetId","path"],Me=["path","targetId"],Fe=["collectionId","parent"],Ue=["indexId","uid"],ze=["uid","sequenceNumber"],Ve=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],Be=["indexId","uid","orderedDocumentKey"],Ge=["userId","collectionPath","documentId"],He=["userId","collectionPath","largestBatchId"],Ke=["userId","collectionGroup","largestBatchId"],$e=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],We=[...$e,"documentOverlays"],Qe=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],Ye=Qe,Je=[...Ye,"indexConfiguration","indexState","indexEntries"],Xe=Je;class Ze extends se{constructor(e,t){super(),this._e=e,this.currentSequenceNumber=t}}function et(e,t){const n=T(e);return ce.F(n._e,t)}function tt(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function nt(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function rt(e,t){const n=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.push(t(e[r],r,e));return n}function it(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class ot{constructor(e,t){this.comparator=e,this.root=t||at.EMPTY}insert(e,t){return new ot(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,at.BLACK,null,null))}remove(e){return new ot(this.comparator,this.root.remove(e,this.comparator).copy(null,null,at.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push(`${t}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new st(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new st(this.root,e,this.comparator,!1)}getReverseIterator(){return new st(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new st(this.root,e,this.comparator,!0)}}class st{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,t&&r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class at{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:at.RED,this.left=null!=r?r:at.EMPTY,this.right=null!=i?i:at.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,i){return new at(null!=e?e:this.key,null!=t?t:this.value,
vendor: 4,413 bytes, line 1
1null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this;const i=n(e,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp()}removeMin(){if(this.left.isEmpty())return at.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,r=this;if(t(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===t(e,r.key)){if(r.right.isEmpty())return at.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,at.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,at.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw b();if(this.right.isRed())throw b();const e=this.left.check();if(e!==this.right.check())throw b();return e+(this.isRed()?0:1)}}at.EMPTY=null,at.RED=!0,at.BLACK=!1,at.EMPTY=new class{constructor(){this.size=0}get key(){throw b()}get value(){throw b()}get color(){throw b()}get left(){throw b()}get right(){throw b()}copy(e,t,n,r,i){return this}insert(e,t,n){return new at(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class ut{constructor(e){this.comparator=e,this.data=new ot(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new lt(this.data.getIterator())}getIteratorFrom(e){return new lt(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof ut))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new ut(this.comparator);return t.data=e,t}}
1class lt{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function ct(e){return e.hasNext()?e.getNext():void 0}class ht{constructor(e){this.fields=e,e.sort(K.comparator)}static empty(){return new ht([])}unionWith(e){let t=new ut(K.comparator);for(const e of this.fields)t=t.add(e);for(const n of e)t=t.add(n);return new ht(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return F(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class dt extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}function ft(){return"undefined"!=typeof atob}class pt{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new dt("Invalid base64 string: "+e):e}}(e);return new pt(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new pt(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return M(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}pt.EMPTY_BYTE_STRING=new pt("");const mt=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function gt(e){if(w(!!e),"string"==typeof e){let t=0;const n=mt.exec(e);if(w(!!n),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const r=new Date(e);return{seconds:Math.floor(r.getTime()/1e3),nanos:t}}return{seconds:_t(e.seconds),nanos:_t(e.nanos)}}function _t(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function yt(e){return"string"==typeof e?pt.fromBase64String(e):pt.fromUint8Array(e)}function vt(e){var t,n;return"server_timestamp"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function bt(e){const t=e.mapValue.fields.__previous_value__;return vt(t)?bt(t):t}function wt(e){const t=gt(e.mapValue.fields.__local_write_time__.timestampValue);return new z(t.seconds,t.nanos)}class It{constructor(e,t,n,r,i,o,s,a,u){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=s,this.longPollingOptions=a,this.useFetchStreams=u}}class Tt{constructor(e,t){this.projectId=e,this.database=t||"(default)"}static empty(){return new Tt("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(e){return e instanceof Tt&&e.projectId===this.projectId&&e.database===this.database}}const Et={mapValue:{fields:{__type__:{stringValue:"__max__"}}}},St={nullValue:"NULL_VALUE"};function At(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?vt(e)?4:Ft(e)?9007199254740991:10:b()}function Ct(e,t){if(e===t)return!0;const n=At(e);if(n!==At(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return wt(e).isEqual(wt(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=gt(e.timestampValue),r=gt(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return yt(e.bytesValue).isEqual(yt(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return _t(e.geoPointValue.latitude)===_t(t.geoPointValue.latitude)&&_t(e.geoPointValue.longitude)===_t(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return _t(e.integerValue)===_t(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=_t(e.doubleValue),r=_t(t.doubleValue);return n===r?Te(n)===Te(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return F(e.arrayValue.values||[],t.arrayValue.values||[],Ct);case 10:return function(e,t){const n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(tt(n)!==tt(r))return!1;for(const e in n)if(n.hasOwnProperty(e)&&(void 0===r[e]||!Ct(n[e],r[e])))return!1;return!0}(e,t);default:return b()}}function kt(e,t){return void 0!==(e.values||[]).find(e=>Ct(e,t))}function xt(e,t){if(e===t)return 0;const n=At(e),r=At(t);if(n!==r)return M(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return M(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=_t(e.integerValue||e.doubleValue),r=_t(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return Nt(e.timestampValue,t.timestampValue);case 4:return Nt(wt(e),wt(t));case 5:return M(e.stringValue,t.stringValue);case 6:return function(e,t){const n=yt(e),r=yt(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),r=t.split("/");for(let e=0;e<n.length&&e<r.length;e++){const t=M(n[e],r[e]);if(0!==t)return t}return M(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=M(_t(e.latitude),_t(t.latitude));return 0!==n?n:M(_t(e.longitude),_t(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return function(e,t){const n=e.values||[],r=t.values||[];for(let e=0;e<n.length&&e<r.length;++e){const t=xt(n[e],r[e]);if(t)return t}return M(n.length,r.length)}(e.arrayValue,t.arrayValue);case 10:return function(e,t){if(e===Et.mapValue&&t===Et.mapValue)return 0;if(e===Et.mapValue)return 1;if(t===Et.mapValue)return-1;const n=e.fields||{},r=Object.keys(n),i=t.fields||{},o=Object.keys(i);r.sort(),o.sort();for(let e=0;e<r.length&&e<o.length;++e){const t=M(r[e],o[e]);if(0!==t)return t;const s=xt(n[r[e]],i[o[e]]);if(0!==s)return s}return M(r.length,o.length)}(e.mapValue,t.mapValue);default:throw b()}}function Nt(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return M(e,t);const n=gt(e),r=gt(t),i=M(n.seconds,r.seconds);return 0!==i?i:M(n.nanos,r.nanos)}function Dt(e){return function e(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(e){const t=gt(e);return`time(${t.seconds},${t.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(e){return yt(e).toBase64()}(t.bytesValue):"referenceValue"in t?function(e){return $.fromName(e).toString()}(t.referenceValue):"geoPointValue"in t?function(e){return`geo(${e.latitude},${e.longitude})`}(t.geoPointValue):"arrayValue"in t?function(t){let n="[",r=!0;for(const i of t.values||[])r?r=!1:n+=",",n+=e(i);return n+"]"}(t.arrayValue):"mapValue"in t?function(t){const n=Object.keys(t.fields||{}).sort();let r="{",i=!0;for(const o of n)i?i=!1:r+=",",r+=`${o}:${e(t.fields[o])}`;return r+"}"}(t.mapValue):b()}(e)}function Ot(e,t){return{referenceValue:`projects/${e.projectId}/databases/${e.database}/documents/${t.path.canonicalString()}`}}function Rt(e){return!!e&&"integerValue"in e}function Pt(e){return!!e&&"arrayValue"in e}function Lt(e){return!!e&&"nullValue"in e}function jt(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function qt(e){return!!e&&"mapValue"in e}function Mt(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};return nt(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=Mt(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=Mt(e.arrayValue.values[n]);return t}return Object.assign({},e)}function Ft(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue}function Ut(e){return"nullValue"in e?St:"booleanValue"in e?{booleanValue:!1}:"integerValue"in e||"doubleValue"in e?{doubleValue:NaN}:"timestampValue"in e?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in e?{stringValue:""}
vendor: 4,234 bytes, line 1
1:"bytesValue"in e?{bytesValue:""}:"referenceValue"in e?Ot(Tt.empty(),$.empty()):"geoPointValue"in e?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in e?{arrayValue:{}}:"mapValue"in e?{mapValue:{}}:b()}function zt(e){return"nullValue"in e?{booleanValue:!1}:"booleanValue"in e?{doubleValue:NaN}:"integerValue"in e||"doubleValue"in e?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in e?{stringValue:""}:"stringValue"in e?{bytesValue:""}:"bytesValue"in e?Ot(Tt.empty(),$.empty()):"referenceValue"in e?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in e?{arrayValue:{}}:"arrayValue"in e?{mapValue:{}}:"mapValue"in e?Et:b()}function Vt(e,t){const n=xt(e.value,t.value);return 0!==n?n:e.inclusive&&!t.inclusive?-1:!e.inclusive&&t.inclusive?1:0}function Bt(e,t){const n=xt(e.value,t.value);return 0!==n?n:e.inclusive&&!t.inclusive?1:!e.inclusive&&t.inclusive?-1:0}class Gt{constructor(e){this.value=e}static empty(){return new Gt({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!qt(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Mt(t)}setAll(e){let t=K.emptyPath(),n={},r=[];e.forEach((e,i)=>{if(!t.isImmediateParentOf(i)){const e=this.getFieldsMap(t);this.applyChanges(e,n,r),n={},r=[],t=i.popLast()}e?n[i.lastSegment()]=Mt(e):r.push(i.lastSegment())});const i=this.getFieldsMap(t);this.applyChanges(i,n,r)}delete(e){const t=this.field(e.popLast());qt(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Ct(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let r=t.mapValue.fields[e.get(n)];qt(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,n){nt(t,(t,n)=>e[t]=n);for(const t of n)delete e[t]}clone(){return new Gt(Mt(this.value))}}function Ht(e){const t=[];return nt(e.fields,(e,n)=>{const r=new K([e]);if(qt(n)){const e=Ht(n.mapValue).fields;if(0===e.length)t.push(r);else for(const n of e)t.push(r.child(n))}else t.push(r)}),new ht(t)}class Kt{constructor(e,t,n,r,i,o,s){this.key=e,this.documentType=t,this.version=n,this.readTime=r,this.createTime=i,this.data=o,this.documentState=s}static newInvalidDocument(e){return new Kt(e,0,V.min(),V.min(),V.min(),Gt.empty(),0)}static newFoundDocument(e,t,n,r){return new Kt(e,1,t,V.min(),n,r,0)}static newNoDocument(e,t){return new Kt(e,2,t,V.min(),V.min(),Gt.empty(),0)}static newUnknownDocument(e,t){return new Kt(e,3,t,V.min(),V.min(),Gt.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(V.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Gt.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Gt.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=V.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof Kt&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Kt(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}
1class $t{constructor(e,t){this.position=e,this.inclusive=t}}function Wt(e,t,n){let r=0;for(let i=0;i<e.position.length;i++){const o=t[i],s=e.position[i];if(r=o.field.isKeyField()?$.comparator($.fromName(s.referenceValue),n.key):xt(s,n.data.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return r}function Qt(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!Ct(e.position[n],t.position[n]))return!1;return!0}class Yt{constructor(e,t="asc"){this.field=e,this.dir=t}}function Jt(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class Xt{}class Zt extends Xt{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new ln(e,t,n):"array-contains"===t?new fn(e,n):"in"===t?new pn(e,n):"not-in"===t?new mn(e,n):"array-contains-any"===t?new gn(e,n):new Zt(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new cn(e,n):new hn(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&this.matchesComparison(xt(t,this.value)):null!==t&&At(this.value)===At(t)&&this.matchesComparison(xt(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return b()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class en extends Xt{constructor(e,t){super(),this.filters=e,this.op=t,this.ae=null}static create(e,t){return new en(e,t)}matches(e){return tn(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.ae||(this.ae=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function tn(e){return"and"===e.op}function nn(e){return"or"===e.op}function rn(e){return on(e)&&tn(e)}function on(e){for(const t of e.filters)if(t instanceof en)return!1;return!0}function sn(e,t){return e instanceof Zt?function(e,t){return t instanceof Zt&&e.op===t.op&&e.field.isEqual(t.field)&&Ct(e.value,t.value)}(e,t):e instanceof en?function(e,t){return t instanceof en&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,n,r)=>e&&sn(n,t.filters[r]),!0)}(e,t):void b()}function an(e,t){const n=e.filters.concat(t);return en.create(n,e.op)}function un(e){return e instanceof Zt?function(e){return`${e.field.canonicalString()} ${e.op} ${Dt(e.value)}`}(e):e instanceof en?function(e){return e.op.toString()+" {"+e.getFilters().map(un).join(" ,")+"}"}(e):"Filter"}class ln extends Zt{constructor(e,t,n){super(e,t,n),this.key=$.fromName(n.referenceValue)}matches(e){const t=$.comparator(e.key,this.key);return this.matchesComparison(t)}}class cn extends Zt{constructor(e,t){super(e,"in",t),this.keys=dn("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class hn extends Zt{constructor(e,t){super(e,"not-in",t),this.keys=dn("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function dn(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map(e=>$.fromName(e.referenceValue))}class fn extends Zt{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Pt(t)&&kt(t.arrayValue,this.value)}}class pn extends Zt{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&kt(this.value.arrayValue,t)}}class mn extends Zt{constructor(e,t){super(e,"not-in",t)}matches(e){if(kt(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&!kt(this.value.arrayValue,t)}}class gn extends Zt{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Pt(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>kt(this.value.arrayValue,e))}}class _n{constructor(e,t=null,n=[],r=[],i=null,o=null,s=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=s,this.ue=null}}function yn(e,t=null,n=[],r=[],i=null,o=null,s=null){return new _n(e,t,n,r,i,o,s)}function vn(e){const t=T(e);if(null===t.ue){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>function e(t){if(t instanceof Zt)return t.field.canonicalString()+t.op.toString()+Dt(t.value);if(rn(t))return t.filters.map(t=>e(t)).join(",");{const n=t.filters.map(t=>e(t)).join(",");return`${t.op}(${n})`}}(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>function(e){return e.field.canonicalString()+e.dir}(e)).join(","),Ie(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>Dt(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>Dt(e)).join(",")),t.ue=e}return t.ue}function bn(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!Jt(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!sn(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!Qt(e.startAt,t.startAt)&&Qt(e.endAt,t.endAt)}function wn(e){return $.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}function In(e,t){return e.filters.filter(e=>e instanceof Zt&&e.field.isEqual(t))}
1function Tn(e,t,n){let r=St,i=!0;for(const n of In(e,t)){let e=St,t=!0;switch(n.op){case"<":case"<=":e=Ut(n.value);break;case"==":case"in":case">=":e=n.value;break;case">":e=n.value,t=!1;break;case"!=":case"not-in":e=St}Vt({value:r,inclusive:i},{value:e,inclusive:t})<0&&(r=e,i=t)}if(null!==n)for(let o=0;o<e.orderBy.length;++o)if(e.orderBy[o].field.isEqual(t)){const e=n.position[o];Vt({value:r,inclusive:i},{value:e,inclusive:n.inclusive})<0&&(r=e,i=n.inclusive);break}return{value:r,inclusive:i}}function En(e,t,n){let r=Et,i=!0;for(const n of In(e,t)){let e=Et,t=!0;switch(n.op){case">=":case">":e=zt(n.value),t=!1;break;case"==":case"in":case"<=":e=n.value;break;case"<":e=n.value,t=!1;break;case"!=":case"not-in":e=Et}Bt({value:r,inclusive:i},{value:e,inclusive:t})>0&&(r=e,i=t)}if(null!==n)for(let o=0;o<e.orderBy.length;++o)if(e.orderBy[o].field.isEqual(t)){const e=n.position[o];Bt({value:r,inclusive:i},{value:e,inclusive:n.inclusive})>0&&(r=e,i=n.inclusive);break}return{value:r,inclusive:i}}class Sn{constructor(e,t=null,n=[],r=[],i=null,o="F",s=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=o,this.startAt=s,this.endAt=a,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function An(e,t,n,r,i,o,s,a){return new Sn(e,t,n,r,i,o,s,a)}function Cn(e){return new Sn(e)}function kn(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function xn(e){return null!==e.collectionGroup}function Nn(e){const t=T(e);if(null===t.ce){t.ce=[];const e=new Set;for(const n of t.explicitOrderBy)t.ce.push(n),e.add(n.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";(function(e){let t=new ut(K.comparator);return e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t})(t).forEach(r=>{e.has(r.canonicalString())||r.isKeyField()||t.ce.push(new Yt(r,n))}),e.has(K.keyField().canonicalString())||t.ce.push(new Yt(K.keyField(),n))}return t.ce}function Dn(e){const t=T(e);return t.le||(t.le=Rn(t,Nn(e))),t.le}function On(e){const t=T(e);return t.he||(t.he=Rn(t,e.explicitOrderBy)),t.he}function Rn(e,t){if("F"===e.limitType)return yn(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{const t="desc"===e.dir?"asc":"desc";return new Yt(e.field,t)});const n=e.endAt?new $t(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new $t(e.startAt.position,e.startAt.inclusive):null;return yn(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}}function Pn(e,t){const n=e.filters.concat([t]);return new Sn(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}function Ln(e,t,n){return new Sn(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function jn(e,t){return bn(Dn(e),Dn(t))&&e.limitType===t.limitType}function qn(e){return`${vn(Dn(e))}|lt:${e.limitType}`}function Mn(e){return`Query(target=${function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map(e=>un(e)).join(", ")}]`),Ie(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map(e=>function(e){return`${e.field.canonicalString()} (${e.dir})`}(e)).join(", ")}]`),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>Dt(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>Dt(e)).join(",")),`Target(${t})`}(Dn(e))}; limitType=${e.limitType})`}function Fn(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):$.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of Nn(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){const r=Wt(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,Nn(e),t)||e.endAt&&!function(e,t,n){const r=Wt(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,Nn(e),t))}(e,t)}function Un(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function zn(e){return(t,n)=>{let r=!1;for(const i of Nn(e)){const e=Vn(i,t,n);if(0!==e)return e;r=r||i.field.isKeyField()}return 0}}function Vn(e,t,n){const r=e.field.isKeyField()?$.comparator(t.key,n.key):function(e,t,n){const r=t.data.field(e),i=n.data.field(e);return null!==r&&null!==i?xt(r,i):b()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return b()}}class Bn{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[t,r]of n)if(this.equalsFn(t,e))return r}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(let n=0;n<r.length;n++)if(this.equalsFn(r[n][0],e))return void(r[n]=[e,t]);
1r.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return 1===n.length?delete this.inner[t]:n.splice(r,1),this.innerSize--,!0;return!1}forEach(e){nt(this.inner,(t,n)=>{for(const[t,r]of n)e(t,r)})}isEmpty(){return it(this.inner)}size(){return this.innerSize}}const Gn=new ot($.comparator);function Hn(){return Gn}const Kn=new ot($.comparator);function $n(...e){let t=Kn;for(const n of e)t=t.insert(n.key,n);return t}function Wn(e){let t=Kn;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function Qn(){return Jn()}function Yn(){return Jn()}function Jn(){return new Bn(e=>e.toString(),(e,t)=>e.isEqual(t))}const Xn=new ot($.comparator),Zn=new ut($.comparator);function er(...e){let t=Zn;for(const n of e)t=t.add(n);return t}const tr=new ut(M);function nr(){return tr}function rr(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Te(t)?"-0":t}}function ir(e){return{integerValue:""+e}}function or(e,t){return Ee(t)?ir(t):rr(e,t)}class sr{constructor(){this._=void 0}}function ar(e,t,n){return e instanceof cr?function(e,t){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&vt(t)&&(t=bt(t)),t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof hr?dr(e,t):e instanceof fr?pr(e,t):function(e,t){const n=lr(e,t),r=gr(n)+gr(e.Pe);return Rt(n)&&Rt(e.Pe)?ir(r):rr(e.serializer,r)}(e,t)}function ur(e,t,n){return e instanceof hr?dr(e,t):e instanceof fr?pr(e,t):n}function lr(e,t){return e instanceof mr?function(e){return Rt(e)||function(e){return!!e&&"doubleValue"in e}(e)}(t)?t:{integerValue:0}:null}class cr extends sr{}class hr extends sr{constructor(e){super(),this.elements=e}}function dr(e,t){const n=_r(t);for(const t of e.elements)n.some(e=>Ct(e,t))||n.push(t);return{arrayValue:{values:n}}}class fr extends sr{constructor(e){super(),this.elements=e}}function pr(e,t){let n=_r(t);for(const t of e.elements)n=n.filter(e=>!Ct(e,t));return{arrayValue:{values:n}}}class mr extends sr{constructor(e,t){super(),this.serializer=e,this.Pe=t}}function gr(e){return _t(e.integerValue||e.doubleValue)}function _r(e){return Pt(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class yr{constructor(e,t){this.field=e,this.transform=t}}class vr{constructor(e,t){this.version=e,this.transformResults=t}}class br{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new br}static exists(e){return new br(void 0,e)}static updateTime(e){return new br(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function wr(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class Ir{}function Tr(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new Rr(e.key,br.none()):new kr(e.key,e.data,br.none());{const n=e.data,r=Gt.empty();let i=new ut(K.comparator);for(let e of t.fields)if(!i.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?r.delete(e):r.set(e,t),i=i.add(e)}return new xr(e.key,r,new ht(i.toArray()),br.none())}}function Er(e,t,n){e instanceof kr?function(e,t,n){const r=e.value.clone(),i=Dr(e.fieldTransforms,t,n.transformResults);r.setAll(i),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):e instanceof xr?function(e,t,n){if(!wr(e.precondition,t))return void t.convertToUnknownDocument(n.version);const r=Dr(e.fieldTransforms,t,n.transformResults),i=t.data;i.setAll(Nr(e)),i.setAll(r),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function Sr(e,t,n,r){return e instanceof kr?function(e,t,n,r){if(!wr(e.precondition,t))return n;const i=e.value.clone(),o=Or(e.fieldTransforms,r,t);return i.setAll(o),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null}(e,t,n,r):e instanceof xr?function(e,t,n,r){if(!wr(e.precondition,t))return n;const i=Or(e.fieldTransforms,r,t),o=t.data;return o.setAll(Nr(e)),o.setAll(i),t.convertToFoundDocument(t.version,o).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,r):function(e,t,n){return wr(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}(e,t,n)}function Ar(e,t){let n=null;for(const r of e.fieldTransforms){const e=t.data.field(r.field),i=lr(r.transform,e||null);null!=i&&(null===n&&(n=Gt.empty()),n.set(r.field,i))}return n||null}function Cr(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&F(e,t,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof hr&&t instanceof hr||e instanceof fr&&t instanceof fr?F(e.elements,t.elements,Ct):e instanceof mr&&t instanceof mr?Ct(e.Pe,t.Pe):e instanceof cr&&t instanceof cr}(e.transform,t.transform)}(e,t))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class kr extends Ir{constructor(e,t,n,r=[]){super(),this.key=e,this.value=t,this.prec
1ondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class xr extends Ir{constructor(e,t,n,r,i=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=r,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function Nr(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}}),t}function Dr(e,t,n){const r=new Map;w(e.length===n.length);for(let i=0;i<n.length;i++){const o=e[i],s=o.transform,a=t.data.field(o.field);r.set(o.field,ur(s,a,n[i]))}return r}function Or(e,t,n){const r=new Map;for(const i of e){const e=i.transform,o=n.data.field(i.field);r.set(i.field,ar(e,o,t))}return r}class Rr extends Ir{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class Pr extends Ir{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class Lr{constructor(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let t=0;t<this.mutations.length;t++){const r=this.mutations[t];r.key.isEqual(e.key)&&Er(r,e,n[t])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=Sr(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=Sr(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=Yn();return this.mutations.forEach(r=>{const i=e.get(r.key),o=i.overlayedDocument;let s=this.applyToLocalView(o,i.mutatedFields);s=t.has(r.key)?null:s;const a=Tr(o,s);null!==a&&n.set(r.key,a),o.isValidDocument()||o.convertToNoDocument(V.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),er())}isEqual(e){return this.batchId===e.batchId&&F(this.mutations,e.mutations,(e,t)=>Cr(e,t))&&F(this.baseMutations,e.baseMutations,(e,t)=>Cr(e,t))}}class jr{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){w(e.mutations.length===n.length);let r=Xn;const i=e.mutations;for(let e=0;e<i.length;e++)r=r.insert(i[e].key,n[e].version);return new jr(e,t,n,r)}}class qr{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{\n      largestBatchId: ${this.largestBatchId},\n      mutation: ${this.mutation.toString()}\n    }`}}class Mr{constructor(e,t,n){this.alias=e,this.aggregateType=t,this.fieldPath=n}}class Fr{constructor(e,t){this.count=e,this.unchangedNames=t}}var Ur,zr;function Vr(e){switch(e){default:return b();case E.CANCELLED:case E.UNKNOWN:case E.DEADLINE_EXCEEDED:case E.RESOURCE_EXHAUSTED:case E.INTERNAL:case E.UNAVAILABLE:case E.UNAUTHENTICATED:return!1;case E.INVALID_ARGUMENT:case E.NOT_FOUND:case E.ALREADY_EXISTS:case E.PERMISSION_DENIED:case E.FAILED_PRECONDITION:case E.ABORTED:case E.OUT_OF_RANGE:case E.UNIMPLEMENTED:case E.DATA_LOSS:return!0}}function Br(e){if(void 0===e)return _("GRPC error has no .code"),E.UNKNOWN;switch(e){case Ur.OK:return E.OK;case Ur.CANCELLED:return E.CANCELLED;case Ur.UNKNOWN:return E.UNKNOWN;case Ur.DEADLINE_EXCEEDED:return E.DEADLINE_EXCEEDED;case Ur.RESOURCE_EXHAUSTED:return E.RESOURCE_EXHAUSTED;case Ur.INTERNAL:return E.INTERNAL;case Ur.UNAVAILABLE:return E.UNAVAILABLE;case Ur.UNAUTHENTICATED:return E.UNAUTHENTICATED;case Ur.INVALID_ARGUMENT:return E.INVALID_ARGUMENT;case Ur.NOT_FOUND:return E.NOT_FOUND;case Ur.ALREADY_EXISTS:return E.ALREADY_EXISTS;case Ur.PERMISSION_DENIED:return E.PERMISSION_DENIED;case Ur.FAILED_PRECONDITION:return E.FAILED_PRECONDITION;case Ur.ABORTED:return E.ABORTED;case Ur.OUT_OF_RANGE:return E.OUT_OF_RANGE;case Ur.UNIMPLEMENTED:return E.UNIMPLEMENTED;case Ur.DATA_LOSS:return E.DATA_LOSS;default:return b()}}(zr=Ur||(Ur={}))[zr.OK=0]="OK",zr[zr.CANCELLED=1]="CANCELLED",zr[zr.UNKNOWN=2]="UNKNOWN",zr[zr.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",zr[zr.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",zr[zr.NOT_FOUND=5]="NOT_FOUND",zr[zr.ALREADY_EXISTS=6]="ALREADY_EXISTS",zr[zr.PERMISSION_DENIED=7]="PERMISSION_DENIED",zr[zr.UNAUTHENTICATED=16]="UNAUTHENTICATED",zr[zr.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",zr[zr.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",zr[zr.ABORTED=10]="ABORTED",zr[zr.OUT_OF_RANGE=11]="OUT_OF_RANGE",zr[zr.UNIMPLEMENT
1ED=12]="UNIMPLEMENTED",zr[zr.INTERNAL=13]="INTERNAL",zr[zr.UNAVAILABLE=14]="UNAVAILABLE",zr[zr.DATA_LOSS=15]="DATA_LOSS";let Gr=null;function Hr(){return new TextEncoder}const Kr=new u.a([4294967295,4294967295],0);function $r(e){const t=Hr().encode(e),n=new u.b;return n.update(t),new Uint8Array(n.digest())}function Wr(e){const t=new DataView(e.buffer),n=t.getUint32(0,!0),r=t.getUint32(4,!0),i=t.getUint32(8,!0),o=t.getUint32(12,!0);return[new u.a([n,r],0),new u.a([i,o],0)]}class Qr{constructor(e,t,n){if(this.bitmap=e,this.padding=t,this.hashCount=n,t<0||t>=8)throw new Yr("Invalid padding: "+t);if(n<0)throw new Yr("Invalid hash count: "+n);if(e.length>0&&0===this.hashCount)throw new Yr("Invalid hash count: "+n);if(0===e.length&&0!==t)throw new Yr("Invalid padding when bitmap length is 0: "+t);this.Ie=8*e.length-t,this.Te=u.a.fromNumber(this.Ie)}Ee(e,t,n){let r=e.add(t.multiply(u.a.fromNumber(n)));return 1===r.compare(Kr)&&(r=new u.a([r.getBits(0),r.getBits(1)],0)),r.modulo(this.Te).toNumber()}de(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(0===this.Ie)return!1;const t=$r(e),[n,r]=Wr(t);for(let e=0;e<this.hashCount;e++){const t=this.Ee(n,r,e);if(!this.de(t))return!1}return!0}static create(e,t,n){const r=e%8==0?0:8-e%8,i=new Uint8Array(Math.ceil(e/8)),o=new Qr(i,r,t);return n.forEach(e=>o.insert(e)),o}insert(e){if(0===this.Ie)return;const t=$r(e),[n,r]=Wr(t);for(let e=0;e<this.hashCount;e++){const t=this.Ee(n,r,e);this.Ae(t)}}Ae(e){const t=Math.floor(e/8),n=e%8;this.bitmap[t]|=1<<n}}class Yr extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class Jr{constructor(e,t,n,r,i){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,t,n){const r=new Map;return r.set(e,Xr.createSynthesizedTargetChangeForCurrentChange(e,t,n)),new Jr(V.min(),r,new ot(M),Hn(),er())}}class Xr{constructor(e,t,n,r,i){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,t,n){return new Xr(n,t,er(),er(),er())}}class Zr{constructor(e,t,n,r){this.Re=e,this.removedTargetIds=t,this.key=n,this.Ve=r}}class ei{constructor(e,t){this.targetId=e,this.me=t}}class ti{constructor(e,t,n=pt.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}class ni{constructor(){this.fe=0,this.ge=oi(),this.pe=pt.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return 0!==this.fe}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}Ce(){let e=er(),t=er(),n=er();return this.ge.forEach((r,i)=>{switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:b()}}),new Xr(this.pe,this.ye,e,t,n)}ve(){this.we=!1,this.ge=oi()}Fe(e,t){this.we=!0,this.ge=this.ge.insert(e,t)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,w(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class ri{constructor(e){this.Le=e,this.Be=new Map,this.ke=Hn(),this.qe=ii(),this.Qe=new ot(M)}Ke(e){for(const t of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(t,e.Ve):this.Ue(t,e.key,e.Ve);for(const t of e.removedTargetIds)this.Ue(t,e.key,e.Ve)}We(e){this.forEachTarget(e,t=>{const n=this.Ge(t);switch(e.state){case 0:this.ze(t)&&n.De(e.resumeToken);break;case 1:n.Oe(),n.Se||n.ve(),n.De(e.resumeToken);break;case 2:n.Oe(),n.Se||this.removeTarget(t);break;case 3:this.ze(t)&&(n.Ne(),n.De(e.resumeToken));break;case 4:this.ze(t)&&(this.je(t),n.De(e.resumeToken));break;default:b()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Be.forEach((e,n)=>{this.ze(n)&&t(n)})}He(e){const t=e.targetId,n=e.me.count,r=this.Je(t);if(r){const i=r.target;if(wn(i))if(0===n){const e=new $(i.path);this.Ue(t,e,Kt.newNoDocument(e,V.min()))}else w(1===n);else{const r=this.Ye(t);if(r!==n){const n=this.Ze(e),i=n?this.Xe(n,e,r):1;if(0!==i){this.je(t);const e=2===i?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(t,e)}null==Gr||Gr.et(function(e,t,n,r,i){var o,s,a,u,l,c;const h={localCacheCount:e,existenceFilterCount:t.count,databaseId:n.database,projectId:n.projectId},d=t.unchangedNames;return d&&(h.bloomFilter={applied:0===i,hashCount:null!==(o=null==d?void 0:d.hashCount)&&void 0!==o?o:0,bitmapLength:null!==(u=null===(a=null===(s=null==d?void 0:d.bits)||void 0===s?void 0:s.bitmap)||void 0===a?void 0:a.length)&&void 0!==u?u:0,padding:null!==(c=null===(l=null==d?void 0:d.bits)||void 0===l?void 0:l.padding)&&void 0!==c?c:0,mightContain:e=>{var t;return null!==(t=null==r?void 0:r.mightContain(e))&&void 0!==t&&t}}),h}(r,e.me,this.Le.tt(),n,i))}}}}Ze(e){const t=e.me.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:n="",padding:r=0},hashCount:i=0}=t;let o,s;try{o=yt(n).toUint8Array()}catch(e){if(e instanceof dt)return y("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw e}try{s=new Qr(o,r,i)}catch(e){return y(e instanceof Yr?"BloomFilter error: ":"Applying bloom filter failed: ",e),null}return 0===s.Ie?null:s}Xe(e,t,n){return t.me.count===n-this.nt(e,t.targetId)?0:2}nt(e,t){const n=this.Le.getRemoteKeysForTarget(t);let r=0;
1return n.forEach(n=>{const i=this.Le.tt(),o=`projects/${i.projectId}/databases/${i.database}/documents/${n.path.canonicalString()}`;e.mightContain(o)||(this.Ue(t,n,null),r++)}),r}rt(e){const t=new Map;this.Be.forEach((n,r)=>{const i=this.Je(r);if(i){if(n.current&&wn(i.target)){const t=new $(i.target.path);null!==this.ke.get(t)||this.it(r,t)||this.Ue(r,t,Kt.newNoDocument(t,e))}n.be&&(t.set(r,n.Ce()),n.ve())}});let n=er();this.qe.forEach((e,t)=>{let r=!0;t.forEachWhile(e=>{const t=this.Je(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(r=!1,!1)}),r&&(n=n.add(e))}),this.ke.forEach((t,n)=>n.setReadTime(e));const r=new Jr(e,t,this.Qe,this.ke,n);return this.ke=Hn(),this.qe=ii(),this.Qe=new ot(M),r}$e(e,t){if(!this.ze(e))return;const n=this.it(e,t.key)?2:0;this.Ge(e).Fe(t.key,n),this.ke=this.ke.insert(t.key,t),this.qe=this.qe.insert(t.key,this.st(t.key).add(e))}Ue(e,t,n){if(!this.ze(e))return;const r=this.Ge(e);this.it(e,t)?r.Fe(t,1):r.Me(t),this.qe=this.qe.insert(t,this.st(t).delete(e)),n&&(this.ke=this.ke.insert(t,n))}removeTarget(e){this.Be.delete(e)}Ye(e){const t=this.Ge(e).Ce();return this.Le.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let t=this.Be.get(e);return t||(t=new ni,this.Be.set(e,t)),t}st(e){let t=this.qe.get(e);return t||(t=new ut(M),this.qe=this.qe.insert(e,t)),t}ze(e){const t=null!==this.Je(e);return t||g("WatchChangeAggregator","Detected inactive target",e),t}Je(e){const t=this.Be.get(e);return t&&t.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new ni),this.Le.getRemoteKeysForTarget(e).forEach(t=>{this.Ue(e,t,null)})}it(e,t){return this.Le.getRemoteKeysForTarget(e).has(t)}}function ii(){return new ot($.comparator)}function oi(){return new ot($.comparator)}const si={asc:"ASCENDING",desc:"DESCENDING"},ai={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ui={and:"AND",or:"OR"};class li{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function ci(e,t){return e.useProto3Json||Ie(t)?t:{value:t}}function hi(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function di(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function fi(e,t){return hi(e,t.toTimestamp())}function pi(e){return w(!!e),V.fromTimestamp(function(e){const t=gt(e);return new z(t.seconds,t.nanos)}(e))}function mi(e,t){return gi(e,t).canonicalString()}function gi(e,t){const n=function(e){return new G(["projects",e.projectId,"databases",e.database])}(e).child("documents");return void 0===t?n:n.child(t)}function _i(e){const t=G.fromString(e);return w(Mi(t)),t}function yi(e,t){return mi(e.databaseId,t.path)}function vi(e,t){const n=_i(t);if(n.get(1)!==e.databaseId.projectId)throw new S(E.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new S(E.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new $(Ti(n))}function bi(e,t){return mi(e.databaseId,t)}function wi(e){const t=_i(e);return 4===t.length?G.emptyPath():Ti(t)}function Ii(e){return new G(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function Ti(e){return w(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function Ei(e,t,n){return{name:yi(e,t),fields:n.value.mapValue.fields}}function Si(e,t,n){const r=vi(e,t.name),i=pi(t.updateTime),o=t.createTime?pi(t.createTime):V.min(),s=new Gt({mapValue:{fields:t.fields}}),a=Kt.newFoundDocument(r,i,o,s);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Ai(e,t){let n;if(t instanceof kr)n={update:Ei(e,t.key,t.value)};else if(t instanceof Rr)n={delete:yi(e,t.key)};else if(t instanceof xr)n={update:Ei(e,t.key,t.data),updateMask:qi(t.fieldMask)};else{if(!(t instanceof Pr))return b();n={verify:yi(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const n=t.transform;if(n instanceof cr)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof hr)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof fr)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof mr)return{fieldPath:t.field.canonicalString(),increment:n.Pe};throw b()}(0,e))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:fi(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:b()}(e,t.precondition)),n}function Ci(e,t){const n=t.currentDocument?function(e){return void 0!==e.updateTime?br.updateTime(pi(e.updateTime)):void 0!==e.exists?br.exists(e.exists):br.none()}(t.currentDocument):br.none(),r=t.updateTransforms?t.updateTransforms.map(t=>function(e,t){let n=null;if("setToServerValue"in t)w("REQUEST_TIME"===t.setToServerValue),n=new cr;else if("appendMissingElements"in t){const e=t.appendMissingElements.values||[];n=new hr(e)}else if("removeAllFromArray"in t){const e=t.removeAllFromArray.values||[];n=new fr(e)}else"increment"in t?n=new mr(e,t.increment):b();const r=K.fromServerFormat(t.fieldPath);return new yr(r,n)}(e,t)):[];if(t.update){t.update.name;const i=vi(e,t.update.name),o=new Gt({mapValue:{fields:t.update.fields}});if(t.updateMask){const e=function(e){const t=e.fieldPaths||[];return new ht(t.map(e=>K.fromServerFormat(e)))}(t.updateMask);return new xr(i,o,e,n,r)}return new kr(i,o,n,r)}if(t.delete){const r=vi(e,t.delete);
1return new Rr(r,n)}if(t.verify){const r=vi(e,t.verify);return new Pr(r,n)}return b()}function ki(e,t){return{documents:[bi(e,t.path)]}}function xi(e,t){const n={structuredQuery:{}},r=t.path;let i;null!==t.collectionGroup?(i=r,n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=bi(e,i);const o=function(e){if(0!==e.length)return function e(t){return t instanceof Zt?function(e){if("=="===e.op){if(jt(e.value))return{unaryFilter:{field:Li(e.field),op:"IS_NAN"}};if(Lt(e.value))return{unaryFilter:{field:Li(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(jt(e.value))return{unaryFilter:{field:Li(e.field),op:"IS_NOT_NAN"}};if(Lt(e.value))return{unaryFilter:{field:Li(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Li(e.field),op:Ri(e.op),value:e.value}}}(t):t instanceof en?function(t){const n=t.getFilters().map(t=>e(t));return 1===n.length?n[0]:{compositeFilter:{op:Pi(t.op),filters:n}}}(t):b()}(en.create(e,"and"))}(t.filters);o&&(n.structuredQuery.where=o);const s=function(e){if(0!==e.length)return e.map(e=>function(e){return{field:Li(e.field),direction:Oi(e.dir)}}(e))}(t.orderBy);s&&(n.structuredQuery.orderBy=s);const a=ci(e,t.limit);return null!==a&&(n.structuredQuery.limit=a),t.startAt&&(n.structuredQuery.startAt=function(e){return{before:e.inclusive,values:e.position}}(t.startAt)),t.endAt&&(n.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),{_t:n,parent:i}}function Ni(e,t,n,r){const{_t:i,parent:o}=xi(e,t),s={},a=[];let u=0;return n.forEach(e=>{const t=r?e.alias:"aggregate_"+u++;s[t]=e.alias,"count"===e.aggregateType?a.push({alias:t,count:{}}):"avg"===e.aggregateType?a.push({alias:t,avg:{field:Li(e.fieldPath)}}):"sum"===e.aggregateType&&a.push({alias:t,sum:{field:Li(e.fieldPath)}})}),{request:{structuredAggregationQuery:{aggregations:a,structuredQuery:i.structuredQuery},parent:i.parent},ut:s,parent:o}}function Di(e){let t=wi(e.parent);const n=e.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){w(1===r);const e=n.from[0];e.allDescendants?i=e.collectionId:t=t.child(e.collectionId)}let o=[];n.where&&(o=function(e){const t=function e(t){return void 0!==t.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=ji(e.unaryFilter.field);return Zt.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=ji(e.unaryFilter.field);return Zt.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const r=ji(e.unaryFilter.field);return Zt.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=ji(e.unaryFilter.field);return Zt.create(i,"!=",{nullValue:"NULL_VALUE"});default:return b()}}(t):void 0!==t.fieldFilter?function(e){return Zt.create(ji(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return b()}}(e.fieldFilter.op),e.fieldFilter.value)}(t):void 0!==t.compositeFilter?function(t){return en.create(t.compositeFilter.filters.map(t=>e(t)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return b()}}(t.compositeFilter.op))}(t):b()}(e);return t instanceof en&&rn(t)?t.getFilters():[t]}(n.where));let s=[];n.orderBy&&(s=function(e){return e.map(e=>function(e){return new Yt(ji(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e))}(n.orderBy));let a=null;n.limit&&(a=function(e){let t;return t="object"==typeof e?e.value:e,Ie(t)?null:t}(n.limit));let u=null;n.startAt&&(u=function(e){const t=!!e.before,n=e.values||[];return new $t(n,t)}(n.startAt));let l=null;return n.endAt&&(l=function(e){const t=!e.before,n=e.values||[];return new $t(n,t)}(n.endAt)),An(t,i,s,o,a,"F",u,l)}function Oi(e){return si[e]}function Ri(e){return ai[e]}function Pi(e){return ui[e]}function Li(e){return{fieldPath:e.canonicalString()}}function ji(e){return K.fromServerFormat(e.fieldPath)}function qi(e){const t=[];
1return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function Mi(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}class Fi{constructor(e,t,n,r,i=V.min(),o=V.min(),s=pt.EMPTY_BYTE_STRING,a=null){this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=s,this.expectedCount=a}withSequenceNumber(e){return new Fi(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Fi(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Fi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Fi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class Ui{constructor(e){this.ct=e}}function zi(e,t){const n=t.key,r={prefixPath:n.getCollectionPath().popLast().toArray(),collectionGroup:n.collectionGroup,documentId:n.path.lastSegment(),readTime:Vi(t.readTime),hasCommittedMutations:t.hasCommittedMutations};if(t.isFoundDocument())r.document=function(e,t){return{name:yi(e,t.key),fields:t.data.value.mapValue.fields,updateTime:hi(e,t.version.toTimestamp()),createTime:hi(e,t.createTime.toTimestamp())}}(e.ct,t);else if(t.isNoDocument())r.noDocument={path:n.path.toArray(),readTime:Bi(t.version)};else{if(!t.isUnknownDocument())return b();r.unknownDocument={path:n.path.toArray(),version:Bi(t.version)}}return r}function Vi(e){const t=e.toTimestamp();return[t.seconds,t.nanoseconds]}function Bi(e){const t=e.toTimestamp();return{seconds:t.seconds,nanoseconds:t.nanoseconds}}function Gi(e){const t=new z(e.seconds,e.nanoseconds);return V.fromTimestamp(t)}function Hi(e,t){const n=(t.baseMutations||[]).map(t=>Ci(e.ct,t));for(let e=0;e<t.mutations.length-1;++e){const n=t.mutations[e];if(e+1<t.mutations.length&&void 0!==t.mutations[e+1].transform){const r=t.mutations[e+1];n.updateTransforms=r.transform.fieldTransforms,t.mutations.splice(e+1,1),++e}}const r=t.mutations.map(t=>Ci(e.ct,t)),i=z.fromMillis(t.localWriteTimeMs);return new Lr(t.batchId,i,n,r)}function Ki(e){const t=Gi(e.readTime),n=void 0!==e.lastLimboFreeSnapshotVersion?Gi(e.lastLimboFreeSnapshotVersion):V.min();let r;return r=function(e){return void 0!==e.documents}(e.query)?function(e){return w(1===e.documents.length),Dn(Cn(wi(e.documents[0])))}(e.query):function(e){return Dn(Di(e))}(e.query),new Fi(r,e.targetId,"TargetPurposeListen",e.lastListenSequenceNumber,t,n,pt.fromBase64String(e.resumeToken))}function $i(e,t){const n=Bi(t.snapshotVersion),r=Bi(t.lastLimboFreeSnapshotVersion);let i;i=wn(t.target)?ki(e.ct,t.target):xi(e.ct,t.target)._t;const o=t.resumeToken.toBase64();return{targetId:t.targetId,canonicalId:vn(t.target),readTime:n,resumeToken:o,lastListenSequenceNumber:t.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:i}}function Wi(e){const t=Di({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Ln(t,t.limit,"L"):t}function Qi(e,t){return new qr(t.largestBatchId,Ci(e.ct,t.overlayMutation))}function Yi(e,t){const n=t.path.lastSegment();return[e,Se(t.path.popLast()),n]}function Ji(e,t,n,r){return{indexId:e,uid:t,sequenceNumber:n,readTime:Bi(r.readTime),documentKey:Se(r.documentKey.path),largestBatchId:r.largestBatchId}}class Xi{getBundleMetadata(e,t){return Zi(e).get(t).next(e=>{if(e)return function(e){return{id:e.bundleId,createTime:Gi(e.createTime),version:e.version}}(e)})}saveBundleMetadata(e,t){return Zi(e).put(function(e){return{bundleId:e.id,createTime:Bi(pi(e.createTime)),version:e.version}}(t))}getNamedQuery(e,t){return eo(e).get(t).next(e=>{if(e)return function(e){return{name:e.name,query:Wi(e.bundledQuery),readTime:Gi(e.readTime)}}(e)})}saveNamedQuery(e,t){return eo(e).put(function(e){return{name:e.name,readTime:Bi(pi(e.readTime)),bundledQuery:e.bundledQuery}}(t))}}function Zi(e){return et(e,"bundles")}
1function eo(e){return et(e,"namedQueries")}class to{constructor(e,t){this.serializer=e,this.userId=t}static lt(e,t){const n=t.uid||"";return new to(e,n)}getOverlay(e,t){return no(e).get(Yi(this.userId,t)).next(e=>e?Qi(this.serializer,e):null)}getOverlays(e,t){const n=Qn();return ue.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){const r=[];return n.forEach((n,i)=>{const o=new qr(t,i);r.push(this.ht(e,o))}),ue.waitFor(r)}removeOverlaysForBatchId(e,t,n){const r=new Set;t.forEach(e=>r.add(Se(e.getCollectionPath())));const i=[];return r.forEach(t=>{const r=IDBKeyRange.bound([this.userId,t,n],[this.userId,t,n+1],!1,!0);i.push(no(e).j("collectionPathOverlayIndex",r))}),ue.waitFor(i)}getOverlaysForCollection(e,t,n){const r=Qn(),i=Se(t),o=IDBKeyRange.bound([this.userId,i,n],[this.userId,i,Number.POSITIVE_INFINITY],!0);return no(e).U("collectionPathOverlayIndex",o).next(e=>{for(const t of e){const e=Qi(this.serializer,t);r.set(e.getKey(),e)}return r})}getOverlaysForCollectionGroup(e,t,n,r){const i=Qn();let o;const s=IDBKeyRange.bound([this.userId,t,n],[this.userId,t,Number.POSITIVE_INFINITY],!0);return no(e).J({index:"collectionGroupOverlayIndex",range:s},(e,t,n)=>{const s=Qi(this.serializer,t);i.size()<r||s.largestBatchId===o?(i.set(s.getKey(),s),o=s.largestBatchId):n.done()}).next(()=>i)}ht(e,t){return no(e).put(function(e,t,n){const[r,i,o]=Yi(t,n.mutation.key);return{userId:t,collectionPath:i,documentId:o,collectionGroup:n.mutation.key.getCollectionGroup(),largestBatchId:n.largestBatchId,overlayMutation:Ai(e.ct,n.mutation)}}(this.serializer,this.userId,t))}}function no(e){return et(e,"documentOverlays")}class ro{constructor(){}Pt(e,t){this.It(e,t),t.Tt()}It(e,t){if("nullValue"in e)this.Et(t,5);else if("booleanValue"in e)this.Et(t,10),t.dt(e.booleanValue?1:0);else if("integerValue"in e)this.Et(t,15),t.dt(_t(e.integerValue));else if("doubleValue"in e){const n=_t(e.doubleValue);isNaN(n)?this.Et(t,13):(this.Et(t,15),Te(n)?t.dt(0):t.dt(n))}else if("timestampValue"in e){let n=e.timestampValue;this.Et(t,20),"string"==typeof n&&(n=gt(n)),t.At(""+(n.seconds||"")),t.dt(n.nanos||0)}else if("stringValue"in e)this.Rt(e.stringValue,t),this.Vt(t);else if("bytesValue"in e)this.Et(t,30),t.ft(yt(e.bytesValue)),this.Vt(t);else if("referenceValue"in e)this.gt(e.referenceValue,t);else if("geoPointValue"in e){const n=e.geoPointValue;this.Et(t,45),t.dt(n.latitude||0),t.dt(n.longitude||0)}else"mapValue"in e?Ft(e)?this.Et(t,Number.MAX_SAFE_INTEGER):(this.yt(e.mapValue,t),this.Vt(t)):"arrayValue"in e?(this.wt(e.arrayValue,t),this.Vt(t)):b()}Rt(e,t){this.Et(t,25),this.St(e,t)}St(e,t){t.At(e)}yt(e,t){const n=e.fields||{};this.Et(t,55);for(const e of Object.keys(n))this.Rt(e,t),this.It(n[e],t)}wt(e,t){const n=e.values||[];this.Et(t,50);for(const e of n)this.It(e,t)}gt(e,t){this.Et(t,37),$.fromName(e).path.forEach(e=>{this.Et(t,60),this.St(e,t)})}Et(e,t){e.dt(t)}Vt(e){e.dt(2)}}function io(e){if(0===e)return 8;let t=0;return!(e>>4)&&(t+=4,e<<=4),!(e>>6)&&(t+=2,e<<=2),!(e>>7)&&(t+=1),t}function oo(e){const t=64-function(e){let t=0;for(let n=0;n<8;++n){const r=io(255&e[n]);if(t+=r,8!==r)break}return t}(e);return Math.ceil(t/8)}ro.bt=new ro;class so{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Dt(e){const t=e[Symbol.iterator]();let n=t.next();for(;!n.done;)this.Ct(n.value),n=t.next();this.vt()}Ft(e){const t=e[Symbol.iterator]();let n=t.next();for(;!n.done;)this.Mt(n.value),n=t.next();this.xt()}Ot(e){for(const t of e){const e=t.charCodeAt(0);if(e<128)this.Ct(e);else if(e<2048)this.Ct(960|e>>>6),this.Ct(128|63&e);else if(t<"\ud800"||"\udbff"<t)this.Ct(480|e>>>12),this.Ct(128|63&e>>>6),this.Ct(128|63&e);else{const e=t.codePointAt(0);this.Ct(240|e>>>18),this.Ct(128|63&e>>>12),this.Ct(128|63&e>>>6),this.Ct(128|63&e)}}this.vt()}Nt(e){for(const t of e){const e=t.charCodeAt(0);if(e<128)this.Mt(e);else if(e<2048)this.Mt(960|e>>>6),this.Mt(128|63&e);else if(t<"\ud800"||"\udbff"<t)this.Mt(480|e>>>12),this.Mt(128|63&e>>>6),this.Mt(128|63&e);else{const e=t.codePointAt(0);this.Mt(240|e>>>18),this.Mt(128|63&e>>>12),this.Mt(128|63&e>>>6),this.Mt(128|63&e)}}this.xt()}Lt(e){const t=this.Bt(e),n=oo(t);this.kt(1+n),this.buffer[this.position++]=255&n;for(let e=t.length-n;e<t.length;++e)this.buffer[this.position++]=255&t[e]}qt(e){const t=this.Bt(e),n=oo(t);this.kt(1+n),this.buffer[this.position++]=~(255&n);for(let e=t.length-n;e<t.length;++e)this.buffer[this.position++]=~(255&t[e])}Qt(){this.Kt(255),this.Kt(255)}$t(){this.Ut(255),this.Ut(255)}reset(){this.position=0}seed(e){this.kt(e.length),this.buffer.set(e,this.position),this.position+=e.length}Wt(){return this.buffer.slice(0,this.position)}Bt(e){const t=function(e){const t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e,!1),new Uint8Array(t.buffer)}(e),n=!!(128&t[0]);t[0]^=n?255:128;for(let e=1;e<t.length;++e)t[e]^=n?255:0;return t}Ct(e){const t=255&e;0===t?(this.Kt(0),this.Kt(255)):255===t?(this.Kt(255),this.Kt(0)):this.Kt(t)}Mt(e){const t=255&e;0===t?(this.Ut(0),this.Ut(255)):255===t?(this.Ut(255),this.Ut(0)):this.Ut(e)}vt(){this.Kt(0),this.Kt(1)}xt(){this.Ut(0),this.Ut(1)}Kt(e){this.kt(1),this.buffer[this.position++]=e}Ut(e){this.kt(1),this.buffer[this.position++]=~e}kt(e){const t=e+this.position;if(t<=this.buffer.length)return;let n=2*this.buffer.length;n<t&&(n=t);
1const r=new Uint8Array(n);r.set(this.buffer),this.buffer=r}}class ao{constructor(e){this.Gt=e}ft(e){this.Gt.Dt(e)}At(e){this.Gt.Ot(e)}dt(e){this.Gt.Lt(e)}Tt(){this.Gt.Qt()}}class uo{constructor(e){this.Gt=e}ft(e){this.Gt.Ft(e)}At(e){this.Gt.Nt(e)}dt(e){this.Gt.qt(e)}Tt(){this.Gt.$t()}}class lo{constructor(){this.Gt=new so,this.zt=new ao(this.Gt),this.jt=new uo(this.Gt)}seed(e){this.Gt.seed(e)}Ht(e){return 0===e?this.zt:this.jt}Wt(){return this.Gt.Wt()}reset(){this.Gt.reset()}}class co{constructor(e,t,n,r){this.indexId=e,this.documentKey=t,this.arrayValue=n,this.directionalValue=r}Jt(){const e=this.directionalValue.length,t=0===e||255===this.directionalValue[e-1]?e+1:e,n=new Uint8Array(t);return n.set(this.directionalValue,0),t!==e?n.set([0],this.directionalValue.length):++n[n.length-1],new co(this.indexId,this.documentKey,this.arrayValue,n)}}function ho(e,t){let n=e.indexId-t.indexId;return 0!==n?n:(n=fo(e.arrayValue,t.arrayValue),0!==n?n:(n=fo(e.directionalValue,t.directionalValue),0!==n?n:$.comparator(e.documentKey,t.documentKey)))}function fo(e,t){for(let n=0;n<e.length&&n<t.length;++n){const r=e[n]-t[n];if(0!==r)return r}return e.length-t.length}class po{constructor(e){this.Yt=new ut((e,t)=>K.comparator(e.field,t.field)),this.collectionId=null!=e.collectionGroup?e.collectionGroup:e.path.lastSegment(),this.Zt=e.orderBy,this.Xt=[];for(const t of e.filters){const e=t;e.isInequality()?this.Yt=this.Yt.add(e):this.Xt.push(e)}}get en(){return this.Yt.size>1}tn(e){if(w(e.collectionGroup===this.collectionId),this.en)return!1;const t=Q(e);if(void 0!==t&&!this.nn(t))return!1;const n=Y(e);let r=new Set,i=0,o=0;for(;i<n.length&&this.nn(n[i]);++i)r=r.add(n[i].fieldPath.canonicalString());if(i===n.length)return!0;if(this.Yt.size>0){const e=this.Yt.getIterator().getNext();if(!r.has(e.field.canonicalString())){const t=n[i];if(!this.rn(e,t)||!this.sn(this.Zt[o++],t))return!1}++i}for(;i<n.length;++i){const e=n[i];if(o>=this.Zt.length||!this.sn(this.Zt[o++],e))return!1}return!0}on(){if(this.en)return null;let e=new ut(K.comparator);const t=[];for(const n of this.Xt)if(!n.field.isKeyField())if("array-contains"===n.op||"array-contains-any"===n.op)t.push(new X(n.field,2));else{if(e.has(n.field))continue;e=e.add(n.field),t.push(new X(n.field,0))}for(const n of this.Zt)n.field.isKeyField()||e.has(n.field)||(e=e.add(n.field),t.push(new X(n.field,"asc"===n.dir?0:1)));return new W(W.UNKNOWN_ID,this.collectionId,t,ee.empty())}nn(e){for(const t of this.Xt)if(this.rn(t,e))return!0;return!1}rn(e,t){if(void 0===e||!e.field.isEqual(t.fieldPath))return!1;const n="array-contains"===e.op||"array-contains-any"===e.op;return 2===t.kind===n}sn(e,t){return!!e.field.isEqual(t.fieldPath)&&(0===t.kind&&"asc"===e.dir||1===t.kind&&"desc"===e.dir)}}function mo(e){return e instanceof Zt}function go(e){return e instanceof en&&rn(e)}function _o(e){return mo(e)||go(e)||function(e){if(e instanceof en&&nn(e)){for(const t of e.getFilters())if(!mo(t)&&!go(t))return!1;return!0}return!1}(e)}function yo(e,t){let n;return w(e instanceof Zt||e instanceof en),w(t instanceof Zt||t instanceof en),n=e instanceof Zt?t instanceof Zt?function(e,t){return en.create([e,t],"and")}(e,t):vo(e,t):t instanceof Zt?vo(t,e):function(e,t){if(w(e.filters.length>0&&t.filters.length>0),tn(e)&&tn(t))return an(e,t.getFilters());const n=nn(e)?e:t,r=nn(e)?t:e,i=n.filters.map(e=>yo(e,r));return en.create(i,"or")}(e,t),bo(n)}function vo(e,t){if(tn(t))return an(t,e.getFilters());{const n=t.filters.map(t=>yo(e,t));return en.create(n,"or")}}function bo(e){if(w(e instanceof Zt||e instanceof en),e instanceof Zt)return e;const t=e.getFilters();if(1===t.length)return bo(t[0]);if(on(e))return e;const n=t.map(e=>bo(e)),r=[];return n.forEach(t=>{t instanceof Zt?r.push(t):t instanceof en&&(t.op===e.op?r.push(...t.filters):r.push(t))}),1===r.length?r[0]:en.create(r,e.op)}class wo{constructor(){this._n=new Io}addToCollectionParentIndex(e,t){return this._n.add(t),ue.resolve()}getCollectionParents(e,t){return ue.resolve(this._n.getEntries(t))}addFieldIndex(e,t){return ue.resolve()}deleteFieldIndex(e,t){return ue.resolve()}deleteAllFieldIndexes(e){return ue.resolve()}createTargetIndexes(e,t){return ue.resolve()}getDocumentsMatchingTarget(e,t){return ue.resolve(null)}getIndexType(e,t){return ue.resolve(0)}getFieldIndexes(e,t){return ue.resolve([])}getNextCollectionGroupToUpdate(e){return ue.resolve(null)}getMinOffset(e,t){return ue.resolve(re.min())}getMinOffsetFromCollectionGroup(e,t){return ue.resolve(re.min())}updateCollectionGroup(e,t,n){return ue.resolve()}updateIndexEntries(e,t){return ue.resolve()}}class Io{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new ut(G.comparator),i=!r.has(n);return this.index[t]=r.add(n),i}has(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new ut(G.comparator)).toArray()}}const To=new Uint8Array(0);class Eo{constructor(e,t){this.databaseId=t,this.an=new Io,this.un=new Bn(e=>vn(e),(e,t)=>bn(e,t)),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.an.has(t)){const n=t.lastSegment(),r=t.popLast();e.addOnCommittedListener(()=>{this.an.add(t)});const i={collectionId:n,parent:Se(r)};return So(e).put(i)}return ue.resolve()}getCollectionParents(e,t){const n=[],r=IDBKeyRange.bound([t,""],[U(t),""],!1,!0);return So(e).U(r).next(e=>{for(const r of e){if(r.collectionId!==t)break;n.push(ke(r.parent))}return n})}addFieldIndex(e,t){const n=Co(e),r=function(e){return{indexId:e.indexId,collectionGroup:e.collectionGroup,fields:e.fields.map(e=>[e.fieldPath.canonicalString(),e.kind])}}(t);delete r.indexId;const i=n.add(r);if(t.indexState){const n=ko(e);return i.next(e=>{n.put(Ji(e,this.uid,t.indexState.sequenceNumber,t.indexState.offset))})}return i.next()}deleteFieldIndex(e,t){const n=Co(e),r=ko(e),i=Ao(e);return n.delete(t.indexId).next(()=>r.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))).next(()=>i.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))}deleteAllFieldIndexes(e){const t=Co(e),n=Ao(e),r=ko(e);return t.j().next(()=>n.j()).next(()=>r.j())}createTargetIndexes(e,t){return ue.forEach(this.cn(t),t=>this.getIndexType(e,t).next(n=>{if(0===n||1===n){const n=new po(t).on();if(null!=n)return this.addFieldIndex(e,n)}}))}getDocumentsMatchingTarget(e,t){const n=Ao(e);let r=!0;const i=new Map;return ue.forEach(this.cn(t),t=>this.ln(e,t).next(e=>{r&&(r=!!e),i.set(t,e)})).next(()=>{if(r){let e=er();const r=[];return ue.forEach(i,(i,o)=>{g("IndexedDbIndexManager",`Using index ${function(e){return`id=${e.indexId}|cg=${e.collectionGroup}|f=${e.fields.map(e=>`${e.fieldPath}:${e.kind}`).join(",")}`}(i)} to execute ${vn(t)}`);const s=function(e,t){const n=Q(t);if(void 0===n)return null;for(const t of In(e,n.fieldPath))switch(t.op){case"array-contains-any":return t.value.arrayValue.values||[];case"array-contains":return[t.value]}return null}(o,i),a=function(e,t){const n=new Map;for(const r of Y(t))for(const t of In(e,r.fieldPath))switch(t.op){case"==":case"in":n.set(r.fieldPath.canonicalString(),t.value);break;case"not-in":case"!=":return n.set(r.fieldPath.canonicalString(),t.value),Array.from(n.values())}return null}(o,i),u=function(e,t){const n=[];let r=!0;for(const i of Y(t)){const t=0===i.kind?Tn(e,i.fieldPath,e.startAt):En(e,i.fieldPath,e.startAt);n.push(t.value),r&&(r=t.inclusive)}return new $t(n,r)}(o,i),l=function(e,t){const n=[];let r=!0;for(const i of Y(t)){const t=0===i.kind?En(e,i.fieldPath,e.endAt):Tn(e,i.fieldPath,e.endAt);n.push(t.value),r&&(r=t.inclusive)}return new $t(n,r)}(o,i),c=this.hn(i,o,u),h=this.hn(i,o,l),d=this.Pn(i,o,a),f=this.In(i.indexId,s,c,u.inclusive,h,l.inclusive,d);return ue.forEach(f,i=>n.G(i,t.limit).next(t=>{t.forEach(t=>{const n=$.fromSegments(t.documentKey);e.has(n)||(e=e.add(n),r.push(n))})}))}).next(()=>r)}return ue.resolve(null)})}cn(e){let t=this.un.get(e);return t||(t=0===e.filters.length?[e]:function(e){if(0===e.getFilters().length)return[];const t=function e(t){if(w(t instanceof Zt||t instanceof en),t instanceof Zt)return t;if(1===t.filters.length)return e(t.filters[0]);const n=t.filters.map(t=>e(t));let r=en.create(n,t.op);return r=bo(r),_o(r)?r:(w(r instanceof en),w(tn(r)),w(r.filters.length>1),r.filters.reduce((e,t)=>
1yo(e,t)))}(function e(t){var n,r;if(w(t instanceof Zt||t instanceof en),t instanceof Zt){if(t instanceof pn){const e=(null===(r=null===(n=t.value.arrayValue)||void 0===n?void 0:n.values)||void 0===r?void 0:r.map(e=>Zt.create(t.field,"==",e)))||[];return en.create(e,"or")}return t}const i=t.filters.map(t=>e(t));return en.create(i,t.op)}(e));return w(_o(t)),mo(t)||go(t)?[t]:t.getFilters()}(en.create(e.filters,"and")).map(t=>yn(e.path,e.collectionGroup,e.orderBy,t.getFilters(),e.limit,e.startAt,e.endAt)),this.un.set(e,t),t)}In(e,t,n,r,i,o,s){const a=(null!=t?t.length:1)*Math.max(n.length,i.length),u=a/(null!=t?t.length:1),l=[];for(let c=0;c<a;++c){const a=t?this.Tn(t[c/u]):To,h=this.En(e,a,n[c%u],r),d=this.dn(e,a,i[c%u],o),f=s.map(t=>this.En(e,a,t,!0));l.push(...this.createRange(h,d,f))}return l}En(e,t,n,r){const i=new co(e,$.empty(),t,n);return r?i:i.Jt()}dn(e,t,n,r){const i=new co(e,$.empty(),t,n);return r?i.Jt():i}ln(e,t){const n=new po(t),r=null!=t.collectionGroup?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,r).next(e=>{let t=null;for(const r of e)n.tn(r)&&(!t||r.fields.length>t.fields.length)&&(t=r);return t})}getIndexType(e,t){let n=2;const r=this.cn(t);return ue.forEach(r,t=>this.ln(e,t).next(e=>{e?0!==n&&e.fields.length<function(e){let t=new ut(K.comparator),n=!1;for(const r of e.filters)for(const e of r.getFlattenedFilters())e.field.isKeyField()||("array-contains"===e.op||"array-contains-any"===e.op?n=!0:t=t.add(e.field));for(const n of e.orderBy)n.field.isKeyField()||(t=t.add(n.field));return t.size+(n?1:0)}(t)&&(n=1):n=0})).next(()=>function(e){return null!==e.limit}(t)&&r.length>1&&2===n?1:n)}An(e,t){const n=new lo;for(const r of Y(e)){const e=t.data.field(r.fieldPath);if(null==e)return null;const i=n.Ht(r.kind);ro.bt.Pt(e,i)}return n.Wt()}Tn(e){const t=new lo;return ro.bt.Pt(e,t.Ht(0)),t.Wt()}Rn(e,t){const n=new lo;return ro.bt.Pt(Ot(this.databaseId,t),n.Ht(function(e){const t=Y(e);return 0===t.length?0:t[t.length-1].kind}(e))),n.Wt()}
1Pn(e,t,n){if(null===n)return[];let r=[];r.push(new lo);let i=0;for(const o of Y(e)){const e=n[i++];for(const n of r)if(this.Vn(t,o.fieldPath)&&Pt(e))r=this.mn(r,o,e);else{const t=n.Ht(o.kind);ro.bt.Pt(e,t)}}return this.fn(r)}hn(e,t,n){return this.Pn(e,t,n.position)}fn(e){const t=[];for(let n=0;n<e.length;++n)t[n]=e[n].Wt();return t}mn(e,t,n){const r=[...e],i=[];for(const e of n.arrayValue.values||[])for(const n of r){const r=new lo;r.seed(n.Wt()),ro.bt.Pt(e,r.Ht(t.kind)),i.push(r)}return i}Vn(e,t){return!!e.filters.find(e=>e instanceof Zt&&e.field.isEqual(t)&&("in"===e.op||"not-in"===e.op))}getFieldIndexes(e,t){const n=Co(e),r=ko(e);return(t?n.U("collectionGroupIndex",IDBKeyRange.bound(t,t)):n.U()).next(e=>{const t=[];return ue.forEach(e,e=>r.get([e.indexId,this.uid]).next(n=>{t.push(function(e,t){const n=t?new ee(t.sequenceNumber,new re(Gi(t.readTime),new $(ke(t.documentKey)),t.largestBatchId)):ee.empty(),r=e.fields.map(([e,t])=>new X(K.fromServerFormat(e),t));return new W(e.indexId,e.collectionGroup,r,n)}(e,n))})).next(()=>t)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(e=>0===e.length?null:(e.sort((e,t)=>{const n=e.indexState.sequenceNumber-t.indexState.sequenceNumber;return 0!==n?n:M(e.collectionGroup,t.collectionGroup)}),e[0].collectionGroup))}updateCollectionGroup(e,t,n){const r=Co(e),i=ko(e);return this.gn(e).next(e=>r.U("collectionGroupIndex",IDBKeyRange.bound(t,t)).next(t=>ue.forEach(t,t=>i.put(Ji(t.indexId,this.uid,e,n)))))}updateIndexEntries(e,t){const n=new Map;return ue.forEach(t,(t,r)=>{const i=n.get(t.collectionGroup);return(i?ue.resolve(i):this.getFieldIndexes(e,t.collectionGroup)).next(i=>(n.set(t.collectionGroup,i),ue.forEach(i,n=>this.pn(e,t,n).next(t=>{const i=this.yn(r,n);return t.isEqual(i)?ue.resolve():this.wn(e,r,n,t,i)}))))})}Sn(e,t,n,r){return Ao(e).put({indexId:r.indexId,uid:this.uid,arrayValue:r.arrayValue,directionalValue:r.directionalValue,orderedDocumentKey:this.Rn(n,t.key),documentKey:t.key.path.toArray()})}bn(e,t,n,r){return Ao(e).delete([r.indexId,this.uid,r.arrayValue,r.directionalValue,this.Rn(n,t.key),t.key.path.toArray()])}pn(e,t,n){const r=Ao(e);let i=new ut(ho);return r.J({index:"documentKeyIndex",range:IDBKeyRange.only([n.indexId,this.uid,this.Rn(n,t)])},(e,r)=>{i=i.add(new co(n.indexId,t,r.arrayValue,r.directionalValue))}).next(()=>i)}yn(e,t){let n=new ut(ho);const r=this.An(t,e);if(null==r)return n;const i=Q(t);if(null!=i){const o=e.data.field(i.fieldPath);if(Pt(o))for(const i of o.arrayValue.values||[])n=n.add(new co(t.indexId,e.key,this.Tn(i),r))}else n=n.add(new co(t.indexId,e.key,To,r));return n}wn(e,t,n,r,i){g("IndexedDbIndexManager","Updating index entries for document '%s'",t.key);const o=[];return function(e,t,n,r,i){const o=e.getIterator(),s=t.getIterator();let a=ct(o),u=ct(s);for(;a||u;){let e=!1,t=!1;if(a&&u){const r=n(a,u);r<0?t=!0:r>0&&(e=!0)}else null!=a?t=!0:e=!0;e?(r(u),u=ct(s)):t?(i(a),a=ct(o)):(a=ct(o),u=ct(s))}}(r,i,ho,r=>{o.push(this.Sn(e,t,n,r))},r=>{o.push(this.bn(e,t,n,r))}),ue.waitFor(o)}gn(e){let t=1;return ko(e).J({index:"sequenceNumberIndex",reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(e,n,r)=>{r.done(),t=n.sequenceNumber+1}).next(()=>t)}createRange(e,t,n){n=n.sort((e,t)=>ho(e,t)).filter((e,t,n)=>!t||0!==ho(e,n[t-1]));const r=[];r.push(e);for(const i of n){const n=ho(i,e),o=ho(i,t);if(0===n)r[0]=e.Jt();else if(n>0&&o<0)r.push(i),r.push(i.Jt());else if(o>0)break}r.push(t);const i=[];for(let e=0;e<r.length;e+=2){if(this.Dn(r[e],r[e+1]))return[];const t=[r[e].indexId,this.uid,r[e].arrayValue,r[e].directionalValue,To,[]],n=[r[e+1].indexId,this.uid,r[e+1].arrayValue,r[e+1].directionalValue,To,[]];i.push(IDBKeyRange.bound(t,n))}return i}Dn(e,t){return ho(e,t)>0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(xo)}getMinOffset(e,t){return ue.mapArray(this.cn(t),t=>this.ln(e,t).next(e=>e||b())).next(xo)}}function So(e){return et(e,"collectionParents")}function Ao(e){return et(e,"indexEntries")}function Co(e){return et(e,"indexConfiguration")}function ko(e){return et(e,"indexState")}function xo(e){w(0!==e.length);let t=e[0].indexState.offset,n=t.largestBatchId;for(let r=1;r<e.length;r++){const i=e[r].indexState.offset;ie(i,t)<0&&(t=i),n<i.largestBatchId&&(n=i.largestBatchId)}return new re(t.readTime,t.documentKey,n)}const No={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class Do{constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}static withCacheSize(e){return new Do(e,Do.DEFAULT_COLLECTION_PE
1RCENTILE,Do.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}}function Oo(e,t,n){const r=e.store("mutations"),i=e.store("documentMutations"),o=[],s=IDBKeyRange.only(n.batchId);let a=0;const u=r.J({range:s},(e,t,n)=>(a++,n.delete()));o.push(u.next(()=>{w(1===a)}));const l=[];for(const e of n.mutations){const r=De(t,e.key.path,n.batchId);o.push(i.delete(r)),l.push(e.key)}return ue.waitFor(o).next(()=>l)}function Ro(e){if(!e)return 0;let t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw b();t=e.noDocument}return JSON.stringify(t).length}Do.DEFAULT_COLLECTION_PERCENTILE=10,Do.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Do.DEFAULT=new Do(41943040,Do.DEFAULT_COLLECTION_PERCENTILE,Do.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Do.DISABLED=new Do(-1,0,0);class Po{constructor(e,t,n,r){this.userId=e,this.serializer=t,this.indexManager=n,this.referenceDelegate=r,this.Cn={}}static lt(e,t,n,r){w(""!==e.uid);const i=e.isAuthenticated()?e.uid:"";return new Po(i,t,n,r)}checkEmpty(e){let t=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return jo(e).J({index:"userMutationsIndex",range:n},(e,n,r)=>{t=!1,r.done()}).next(()=>t)}addMutationBatch(e,t,n,r){const i=qo(e),o=jo(e);return o.add({}).next(s=>{w("number"==typeof s);const a=new Lr(s,t,n,r),u=function(e,t,n){const r=n.baseMutations.map(t=>Ai(e.ct,t)),i=n.mutations.map(t=>Ai(e.ct,t));return{userId:t,batchId:n.batchId,localWriteTimeMs:n.localWriteTime.toMillis(),baseMutations:r,mutations:i}}(this.serializer,this.userId,a),l=[];let c=new ut((e,t)=>M(e.canonicalString(),t.canonicalString()));for(const e of r){const t=De(this.userId,e.key.path,s);c=c.add(e.key.path.popLast()),l.push(o.put(u)),l.push(i.put(t,Oe))}return c.forEach(t=>{l.push(this.indexManager.addToCollectionParentIndex(e,t))}),e.addOnCommittedListener(()=>{this.Cn[s]=a.keys()}),ue.waitFor(l).next(()=>a)})}lookupMutationBatch(e,t){return jo(e).get(t).next(e=>e?(w(e.userId===this.userId),Hi(this.serializer,e)):null)}vn(e,t){return this.Cn[t]?ue.resolve(this.Cn[t]):this.lookupMutationBatch(e,t).next(e=>{if(e){const n=e.keys();return this.Cn[t]=n,n}return null})}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=IDBKeyRange.lowerBound([this.userId,n]);let i=null;return jo(e).J({index:"userMutationsIndex",range:r},(e,t,r)=>{t.userId===this.userId&&(w(t.batchId>=n),i=Hi(this.serializer,t)),r.done()}).next(()=>i)}getHighestUnacknowledgedBatchId(e){const t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return jo(e).J({index:"userMutationsIndex",range:t,reverse:!0},(e,t,r)=>{n=t.batchId,r.done()}).next(()=>n)}getAllMutationBatches(e){const t=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return jo(e).U("userMutationsIndex",t).next(e=>e.map(e=>Hi(this.serializer,e)))}getAllMutationBatchesAffectingDocumentKey(e,t){const n=Ne(this.userId,t.path),r=IDBKeyRange.lowerBound(n),i=[];return qo(e).J({range:r},(n,r,o)=>{const[s,a,u]=n,l=ke(a);if(s===this.userId&&t.path.isEqual(l))return jo(e).get(u).next(e=>{if(!e)throw b();w(e.userId===this.userId),i.push(Hi(this.serializer,e))});o.done()}).next(()=>i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ut(M);const r=[];return t.forEach(t=>{const i=Ne(this.userId,t.path),o=IDBKeyRange.lowerBound(i),s=qo(e).J({range:o},(e,r,i)=>{const[o,s,a]=e,u=ke(s);o===this.userId&&t.path.isEqual(u)?n=n.add(a):i.done()});r.push(s)}),ue.waitFor(r).next(()=>this.Fn(e,n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1,i=Ne(this.userId,n),o=IDBKeyRange.lowerBound(i);let s=new ut(M);return qo(e).J({range:o},(e,t,i)=>{const[o,a,u]=e,l=ke(a);o===this.userId&&n.isPrefixOf(l)?l.length===r&&(s=s.add(u)):i.done()}).next(()=>this.Fn(e,s))}Fn(e,t){const n=[],r=[];return t.forEach(t=>{r.push(jo(e).get(t).next(e=>{if(null===e)throw b();w(e.userId===this.userId),n.push(Hi(this.serializer,e))}))}),ue.waitFor(r).next(()=>n)}removeMutationBatch(e,t){return Oo(e._e,this.userId,t).next(n=>(e.addOnCommittedListener(()=>{this.Mn(t.batchId)}),ue.forEach(n,t=>this.referenceDelegate.markPotentiallyOrphaned(e,t))))}Mn(e){delete this.Cn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(t=>
1{if(!t)return ue.resolve();const n=IDBKeyRange.lowerBound(function(e){return[e]}(this.userId)),r=[];return qo(e).J({range:n},(e,t,n)=>{if(e[0]===this.userId){const t=ke(e[1]);r.push(t)}else n.done()}).next(()=>{w(0===r.length)})})}containsKey(e,t){return Lo(e,this.userId,t)}xn(e){return Mo(e).get(this.userId).next(e=>e||{userId:this.userId,lastAcknowledgedBatchId:-1,lastStreamToken:""})}}function Lo(e,t,n){const r=Ne(t,n.path),i=r[1],o=IDBKeyRange.lowerBound(r);let s=!1;return qo(e).J({range:o,H:!0},(e,n,r)=>{const[o,a,u]=e;o===t&&a===i&&(s=!0),r.done()}).next(()=>s)}function jo(e){return et(e,"mutations")}function qo(e){return et(e,"documentMutations")}function Mo(e){return et(e,"mutationQueues")}class Fo{constructor(e){this.On=e}next(){return this.On+=2,this.On}static Nn(){return new Fo(0)}static Ln(){return new Fo(-1)}}class Uo{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.Bn(e).next(t=>{const n=new Fo(t.highestTargetId);return t.highestTargetId=n.next(),this.kn(e,t).next(()=>t.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.Bn(e).next(e=>V.fromTimestamp(new z(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.Bn(e).next(e=>e.highestListenSequenceNumber)}setTargetsMetadata(e,t,n){return this.Bn(e).next(r=>(r.highestListenSequenceNumber=t,n&&(r.lastRemoteSnapshotVersion=n.toTimestamp()),t>r.highestListenSequenceNumber&&(r.highestListenSequenceNumber=t),this.kn(e,r)))}addTargetData(e,t){return this.qn(e,t).next(()=>this.Bn(e).next(n=>(n.targetCount+=1,this.Qn(t,n),this.kn(e,n))))}updateTargetData(e,t){return this.qn(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next(()=>zo(e).delete(t.targetId)).next(()=>this.Bn(e)).next(t=>(w(t.targetCount>0),t.targetCount-=1,this.kn(e,t)))}removeTargets(e,t,n){let r=0;const i=[];return zo(e).J((o,s)=>{const a=Ki(s);a.sequenceNumber<=t&&null===n.get(a.targetId)&&(r++,i.push(this.removeTargetData(e,a)))}).next(()=>ue.waitFor(i)).next(()=>r)}forEachTarget(e,t){return zo(e).J((e,n)=>{const r=Ki(n);t(r)})}Bn(e){return Vo(e).get("targetGlobalKey").next(e=>(w(null!==e),e))}kn(e,t){return Vo(e).put("targetGlobalKey",t)}qn(e,t){return zo(e).put($i(this.serializer,t))}Qn(e,t){let n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n}getTargetCount(e){return this.Bn(e).next(e=>e.targetCount)}getTargetData(e,t){const n=vn(t),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let i=null;return zo(e).J({range:r,index:"queryTargetsIndex"},(e,n,r)=>{const o=Ki(n);bn(t,o.target)&&(i=o,r.done())}).next(()=>i)}addMatchingKeys(e,t,n){const r=[],i=Bo(e);return t.forEach(t=>{const o=Se(t.path);r.push(i.put({targetId:n,path:o})),r.push(this.referenceDelegate.addReference(e,n,t))}),ue.waitFor(r)}removeMatchingKeys(e,t,n){const r=Bo(e);return ue.forEach(t,t=>{const i=Se(t.path);return ue.waitFor([r.delete([n,i]),this.referenceDelegate.removeReference(e,n,t)])})}removeMatchingKeysForTargetId(e,t){const n=Bo(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)}getMatchingKeysForTargetId(e,t){const n=IDBKeyRange.bound([t],[t+1],!1,!0),r=Bo(e);let i=er();return r.J({range:n,H:!0},(e,t,n)=>{const r=ke(e[1]),o=new $(r);i=i.add(o)}).next(()=>i)}containsKey(e,t){const n=Se(t.path),r=IDBKeyRange.bound([n],[U(n)],!1,!0);let i=0;return Bo(e).J({index:"documentTargetsIndex",H:!0,range:r},([e,t],n,r)=>{0!==e&&(i++,r.done())}).next(()=>i>0)}ot(e,t){return zo(e).get(t).next(e=>e?Ki(e):null)}}function zo(e){return et(e,"targets")}function Vo(e){return et(e,"targetGlobal")}function Bo(e){return et(e,"targetDocuments")}function Go([e,t],[n,r]){const i=M(e,n);return 0===i?M(t,r):i}class Ho{constructor(e){this.Kn=e,this.buffer=new ut(Go),this.$n=0}Un(){return++this.$n}Wn(e){const t=[e,this.Un()];if(this.buffer.size<this.Kn)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();Go(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class Ko{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.Gn=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.zn(6e4)}stop(){this.Gn&&(this.Gn.cancel(),this.Gn=null)}get started(){return null!==this.Gn}zn(e){g("LruGarbageCollector",`Garbage collection scheduled in ${e}ms`),this.Gn=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Gn=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){pe(e)?g("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e):await ae(e)}await this.zn(3e5)})}}class $o{constructor(e,t){this.jn=e,this.params=t}calculateTargetCount(e,t){return this.jn.Hn(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return ue.resolve(we.oe);const n=new Ho(t);return this.jn.forEachTarget(e,e=>n.Wn(e.sequenceNumber)).next(()=>this.jn.Jn(e,e=>n.Wn(e))).next(()=>n.maxValue)}removeTargets(e,t,n){return this.jn.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.jn.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(g("LruGarbageCollector","Garbage collection skipped; disabled"),ue.resolve(No)):this.getCacheSize(e).next(n=>n<this.params.cacheSizeCollectionThreshold?(g("LruGarbageCollector",`Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),No):this.Yn(e,t))}getCacheSize(e){return this.jn.getCacheSize(e)}Yn(e,t){let n,r,i,o,a,u,l;const c=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(g("LruGarbageCollector",`C
1apping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),r=this.params.maximumSequenceNumbersToCollect):r=t,o=Date.now(),this.nthSequenceNumber(e,r))).next(r=>(n=r,a=Date.now(),this.removeTargets(e,n,t))).next(t=>(i=t,u=Date.now(),this.removeOrphanedDocuments(e,n))).next(e=>(l=Date.now(),p()<=s.a.DEBUG&&g("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${o-c}ms\n\tDetermined least recently used ${r} in `+(a-o)+"ms\n"+`\tRemoved ${i} targets in `+(u-a)+"ms\n"+`\tRemoved ${e} documents in `+(l-u)+"ms\n"+`Total Duration: ${l-c}ms`),ue.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:e})))}}function Wo(e,t){return new $o(e,t)}class Qo{constructor(e,t){this.db=e,this.garbageCollector=Wo(this,t)}Hn(e){const t=this.Zn(e);return this.db.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Zn(e){let t=0;return this.Jn(e,e=>{t++}).next(()=>t)}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}Jn(e,t){return this.Xn(e,(e,n)=>t(n))}addReference(e,t,n){return Yo(e,n)}removeReference(e,t,n){return Yo(e,n)}removeTargets(e,t,n){return this.db.getTargetCache().removeTargets(e,t,n)}markPotentiallyOrphaned(e,t){return Yo(e,t)}er(e,t){return function(e,t){let n=!1;return Mo(e).Y(r=>Lo(e,r,t).next(e=>(e&&(n=!0),ue.resolve(!e)))).next(()=>n)}(e,t)}removeOrphanedDocuments(e,t){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),r=[];let i=0;return this.Xn(e,(o,s)=>{if(s<=t){const t=this.er(e,o).next(t=>{if(!t)return i++,n.getEntry(e,o).next(()=>(n.removeEntry(o,V.min()),Bo(e).delete(function(e){return[0,Se(e.path)]}(o))))});r.push(t)}}).next(()=>ue.waitFor(r)).next(()=>n.apply(e)).next(()=>i)}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,n)}updateLimboDocument(e,t){return Yo(e,t)}Xn(e,t){const n=Bo(e);let r,i=we.oe;return n.J({index:"documentTargetsIndex"},([e,n],{path:o,sequenceNumber:s})=>{0===e?(i!==we.oe&&t(new $(ke(r)),i),i=s,r=o):i=we.oe}).next(()=>{i!==we.oe&&t(new $(ke(r)),i)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function Yo(e,t){return Bo(e).put(function(e,t){return{targetId:0,path:Se(e.path),sequenceNumber:t}}(t,e.currentSequenceNumber))}class Jo{constructor(){this.changes=new Bn(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Kt.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?ue.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class Xo{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,n){return ns(e).put(n)}removeEntry(e,t,n){return ns(e).delete(function(e,t){const n=e.path.toArray();return[n.slice(0,n.length-2),n[n.length-2],Vi(t),n[n.length-1]]}(t,n))}updateMetadata(e,t){return this.getMetadata(e).next(n=>(n.byteSize+=t,this.tr(e,n)))}getEntry(e,t){let n=Kt.newInvalidDocument(t);return ns(e).J({index:"documentKeyIndex",range:IDBKeyRange.only(rs(t))},(e,r)=>{n=this.nr(t,r)}).next(()=>n)}rr(e,t){let n={size:0,document:Kt.newInvalidDocument(t)};return ns(e).J({index:"documentKeyIndex",range:IDBKeyRange.only(rs(t))},(e,r)=>{n={document:this.nr(t,r),size:Ro(r)}}).next(()=>n)}getEntries(e,t){let n=Hn();return this.ir(e,t,(e,t)=>{const r=this.nr(e,t);n=n.insert(e,r)}).next(()=>n)}sr(e,t){let n=Hn(),r=new ot($.comparator);return this.ir(e,t,(e,t)=>{const i=this.nr(e,t);n=n.insert(e,i),r=r.insert(e,Ro(t))}).next(()=>({documents:n,_r:r}))}ir(e,t,n){if(t.isEmpty())return ue.resolve();let r=new ut(os);t.forEach(e=>r=r.add(e));const i=IDBKeyRange.bound(rs(r.first()),rs(r.last())),o=r.getIterator();let s=o.getNext();return ns(e).J({index:"documentKeyIndex",range:i},(e,t,r)=>{const i=$.fromSegments([...t.prefixPath,t.collectionGroup,t.documentId]);for(;s&&os(s,i)<0;)n(s,null),s=o.getNext();s&&s.isEqual(i)&&(n(s,t),s=o.hasNext()?o.getNext():null),s?r.$(rs(s)):r.done()}).next(()=>{for(;s;)n(s,null),s=o.hasNext()?o.getNext():null})}getDocumentsMatchingQuery(e,t,n,r,i){const o=t.path,s=[o.popLast().toArray(),o.lastSegment(),Vi(n.readTime),n.documentKey.path.isEmpty()?"":n.documentKey.path.lastSegment()],a=[o.popLast().toArray(),o.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return ns(e).U(IDBKeyRange.bound(s,a,!0)).next(e=>{null==i||i.incrementDocumentReadCount(e.length);let n=Hn();for(const i of e){const e=this.nr($.fromSegments(i.prefixPath.concat(i.collectionGroup,i.documentId)),i);
1e.isFoundDocument()&&(Fn(t,e)||r.has(e.key))&&(n=n.insert(e.key,e))}return n})}getAllFromCollectionGroup(e,t,n,r){let i=Hn();const o=is(t,n),s=is(t,re.max());return ns(e).J({index:"collectionGroupIndex",range:IDBKeyRange.bound(o,s,!0)},(e,t,n)=>{const o=this.nr($.fromSegments(t.prefixPath.concat(t.collectionGroup,t.documentId)),t);i=i.insert(o.key,o),i.size===r&&n.done()}).next(()=>i)}newChangeBuffer(e){return new es(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(e=>e.byteSize)}getMetadata(e){return ts(e).get("remoteDocumentGlobalKey").next(e=>(w(!!e),e))}tr(e,t){return ts(e).put("remoteDocumentGlobalKey",t)}nr(e,t){if(t){const e=function(e,t){let n;if(t.document)n=Si(e.ct,t.document,!!t.hasCommittedMutations);else if(t.noDocument){const e=$.fromSegments(t.noDocument.path),r=Gi(t.noDocument.readTime);n=Kt.newNoDocument(e,r),t.hasCommittedMutations&&n.setHasCommittedMutations()}else{if(!t.unknownDocument)return b();{const e=$.fromSegments(t.unknownDocument.path),r=Gi(t.unknownDocument.version);n=Kt.newUnknownDocument(e,r)}}return t.readTime&&n.setReadTime(function(e){const t=new z(e[0],e[1]);return V.fromTimestamp(t)}(t.readTime)),n}(this.serializer,t);if(!e.isNoDocument()||!e.version.isEqual(V.min()))return e}return Kt.newInvalidDocument(e)}}function Zo(e){return new Xo(e)}class es extends Jo{constructor(e,t){super(),this.ar=e,this.trackRemovals=t,this.ur=new Bn(e=>e.toString(),(e,t)=>e.isEqual(t))}applyChanges(e){const t=[];let n=0,r=new ut((e,t)=>M(e.canonicalString(),t.canonicalString()));
1return this.changes.forEach((i,o)=>{const s=this.ur.get(i);if(t.push(this.ar.removeEntry(e,i,s.readTime)),o.isValidDocument()){const a=zi(this.ar.serializer,o);r=r.add(i.path.popLast());const u=Ro(a);n+=u-s.size,t.push(this.ar.addEntry(e,i,a))}else if(n-=s.size,this.trackRemovals){const n=zi(this.ar.serializer,o.convertToNoDocument(V.min()));t.push(this.ar.addEntry(e,i,n))}}),r.forEach(n=>{t.push(this.ar.indexManager.addToCollectionParentIndex(e,n))}),t.push(this.ar.updateMetadata(e,n)),ue.waitFor(t)}getFromCache(e,t){return this.ar.rr(e,t).next(e=>(this.ur.set(t,{size:e.size,readTime:e.document.readTime}),e.document))}getAllFromCache(e,t){return this.ar.sr(e,t).next(({documents:e,_r:t})=>(t.forEach((t,n)=>{this.ur.set(t,{size:n,readTime:e.get(t).readTime})}),e))}}function ts(e){return et(e,"remoteDocumentGlobal")}function ns(e){return et(e,"remoteDocumentsV14")}function rs(e){const t=e.path.toArray();return[t.slice(0,t.length-2),t[t.length-2],t[t.length-1]]}function is(e,t){const n=t.documentKey.path.toArray();return[e,Vi(t.readTime),n.slice(0,n.length-2),n.length>0?n[n.length-1]:""]}function os(e,t){const n=e.path.toArray(),r=t.path.toArray();let i=0;for(let e=0;e<n.length-2&&e<r.length-2;++e)if(i=M(n[e],r[e]),i)return i;return i=M(n.length,r.length),i||(i=M(n[n.length-2],r[r.length-2]),i||M(n[n.length-1],r[r.length-1]))}class ss{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class as{constructor(e,t,n,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=r}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(r=>(n=r,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&Sr(n.mutation,e,ht.empty(),z.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,er()).next(()=>t))}getLocalViewOfDocuments(e,t,n=er()){const r=Qn();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,n).next(e=>{let t=$n();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const n=Qn();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,er()))}populateOverlays(e,t,n){const r=[];return n.forEach(e=>{t.has(e)||r.push(e)}),this.documentOverlayCache.getOverlays(e,r).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,r){let i=Hn();const o=Jn(),s=Jn();return t.forEach((e,t)=>{const s=n.get(t.key);r.has(t.key)&&(void 0===s||s.mutation instanceof xr)?i=i.insert(t.key,t):void 0!==s?(o.set(t.key,s.mutation.getFieldMask()),Sr(s.mutation,t,s.mutation.getFieldMask(),z.now())):o.set(t.key,ht.empty())}),this.recalculateAndSaveOverlays(e,i).next(e=>(e.forEach((e,t)=>o.set(e,t)),t.forEach((e,t)=>{var n;return s.set(e,new ss(t,null!==(n=o.get(e))&&void 0!==n?n:null))}),s))}recalculateAndSaveOverlays(e,t){const n=Jn();let r=new ot((e,t)=>e-t),i=er();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const i of e)i.keys().forEach(e=>{const o=t.get(e);if(null===o)return;let s=n.get(e)||ht.empty();s=i.applyToLocalView(o,s),n.set(e,s);const a=(r.get(i.batchId)||er()).add(e);r=r.insert(i.batchId,a)})}).next(()=>{const o=[],s=r.getReverseIterator();for(;s.hasNext();){const r=s.getNext(),a=r.key,u=r.value,l=Yn();u.forEach(e=>{if(!i.has(e)){const r=Tr(t.get(e),n.get(e));null!==r&&l.set(e,r),i=i.add(e)}}),o.push(this.documentOverlayCache.saveOverlays(e,a,l))}return ue.waitFor(o)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n,r){return function(e){return $.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):xn(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,r):this.getDocumentsMatchingCollectionQuery(e,t,n,r)}getNextDocuments(e,t,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,r).next(i=>{const o=r-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,r-i.size):ue.resolve(Qn());let s=-1,a=i;return o.next(t=>ue.forEach(t,(t,n)=>(s<n.largestBatchId&&(s=n.largestBatchId),i.get(t)?ue.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{a=a.insert(t,e)}))).next(()=>this.populateOverlays(e,t,i)).next(()=>this.computeViews(e,a,t,er())).next(e=>({batchId:s,changes:Wn(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new $(t)).next(e=>{let t=$n();
1return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n,r){const i=t.collectionGroup;let o=$n();return this.indexManager.getCollectionParents(e,i).next(s=>ue.forEach(s,s=>{const a=function(e,t){return new Sn(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,s.child(i));return this.getDocumentsMatchingCollectionQuery(e,a,n,r).next(e=>{e.forEach((e,t)=>{o=o.insert(e,t)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,t,n,r){let i;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(o=>(i=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,i,r))).next(e=>{i.forEach((t,n)=>{const r=n.getKey();null===e.get(r)&&(e=e.insert(r,Kt.newInvalidDocument(r)))});let n=$n();return e.forEach((e,r)=>{const o=i.get(e);void 0!==o&&Sr(o.mutation,r,ht.empty(),z.now()),Fn(t,r)&&(n=n.insert(e,r))}),n})}}class us{constructor(e){this.serializer=e,this.cr=new Map,this.lr=new Map}getBundleMetadata(e,t){return ue.resolve(this.cr.get(t))}saveBundleMetadata(e,t){return this.cr.set(t.id,function(e){return{id:e.id,version:e.version,createTime:pi(e.createTime)}}(t)),ue.resolve()}getNamedQuery(e,t){return ue.resolve(this.lr.get(t))}saveNamedQuery(e,t){return this.lr.set(t.name,function(e){return{name:e.name,query:Wi(e.bundledQuery),readTime:pi(e.readTime)}}(t)),ue.resolve()}}class ls{constructor(){this.overlays=new ot($.comparator),this.hr=new Map}getOverlay(e,t){return ue.resolve(this.overlays.get(t))}getOverlays(e,t){const n=Qn();return ue.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){return n.forEach((n,r)=>{this.ht(e,t,r)}),ue.resolve()}removeOverlaysForBatchId(e,t,n){const r=this.hr.get(n);return void 0!==r&&(r.forEach(e=>this.overlays=this.overlays.remove(e)),this.hr.delete(n)),ue.resolve()}getOverlaysForCollection(e,t,n){const r=Qn(),i=t.length+1,o=new $(t.child("")),s=this.overlays.getIteratorFrom(o);for(;s.hasNext();){const e=s.getNext().value,o=e.getKey();if(!t.isPrefixOf(o.path))break;o.path.length===i&&e.largestBatchId>n&&r.set(e.getKey(),e)}return ue.resolve(r)}getOverlaysForCollectionGroup(e,t,n,r){let i=new ot((e,t)=>e-t);const o=this.overlays.getIterator();for(;o.hasNext();){const e=o.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=i.get(e.largestBatchId);null===t&&(t=Qn(),i=i.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const s=Qn(),a=i.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach((e,t)=>s.set(e,t)),!(s.size()>=r)););return ue.resolve(s)}ht(e,t,n){const r=this.overlays.get(n.key);if(null!==r){const e=this.hr.get(r.largestBatchId).delete(n.key);this.hr.set(r.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new qr(t,n));let i=this.hr.get(t);void 0===i&&(i=er(),this.hr.set(t,i)),this.hr.set(t,i.add(n.key))}}class cs{constructor(){this.Pr=new ut(hs.Ir),this.Tr=new ut(hs.Er)}isEmpty(){return this.Pr.isEmpty()}addReference(e,t){const n=new hs(e,t);this.Pr=this.Pr.add(n),this.Tr=this.Tr.add(n)}dr(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Ar(new hs(e,t))}Rr(e,t){e.forEach(e=>this.removeReference(e,t))}Vr(e){const t=new $(new G([])),n=new hs(t,e),r=new hs(t,e+1),i=[];return this.Tr.forEachInRange([n,r],e=>{this.Ar(e),i.push(e.key)}),i}mr(){this.Pr.forEach(e=>this.Ar(e))}Ar(e){this.Pr=this.Pr.delete(e),this.Tr=this.Tr.delete(e)}gr(e){const t=new $(new G([])),n=new hs(t,e),r=new hs(t,e+1);let i=er();return this.Tr.forEachInRange([n,r],e=>{i=i.add(e.key)}),i}containsKey(e){const t=new hs(e,0),n=this.Pr.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class hs{constructor(e,t){this.key=e,this.pr=t}static Ir(e,t){return $.comparator(e.key,t.key)||M(e.pr,t.pr)}static Er(e,t){return M(e.pr,t.pr)||$.comparator(e.key,t.key)}}class ds{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.yr=1,this.wr=new ut(hs.Ir)}checkEmpty(e){return ue.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,r){const i=this.yr;
1this.yr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new Lr(i,t,n,r);this.mutationQueue.push(o);for(const t of r)this.wr=this.wr.add(new hs(t.key,i)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return ue.resolve(o)}lookupMutationBatch(e,t){return ue.resolve(this.Sr(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=this.br(n),i=r<0?0:r;return ue.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return ue.resolve(0===this.mutationQueue.length?-1:this.yr-1)}getAllMutationBatches(e){return ue.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new hs(t,0),r=new hs(t,Number.POSITIVE_INFINITY),i=[];return this.wr.forEachInRange([n,r],e=>{const t=this.Sr(e.pr);i.push(t)}),ue.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ut(M);return t.forEach(e=>{const t=new hs(e,0),r=new hs(e,Number.POSITIVE_INFINITY);this.wr.forEachInRange([t,r],e=>{n=n.add(e.pr)})}),ue.resolve(this.Dr(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1;let i=n;$.isDocumentKey(i)||(i=i.child(""));const o=new hs(new $(i),0);let s=new ut(M);return this.wr.forEachWhile(e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(s=s.add(e.pr)),!0)},o),ue.resolve(this.Dr(s))}Dr(e){const t=[];return e.forEach(e=>{const n=this.Sr(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){w(0===this.Cr(t.batchId,"removed")),this.mutationQueue.shift();let n=this.wr;return ue.forEach(t.mutations,r=>{const i=new hs(r.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)}).next(()=>{this.wr=n})}Mn(e){}containsKey(e,t){const n=new hs(t,0),r=this.wr.firstAfterOrEqual(n);return ue.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,ue.resolve()}Cr(e,t){return this.br(e)}br(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Sr(e){const t=this.br(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class fs{constructor(e){this.vr=e,this.docs=new ot($.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,r=this.docs.get(n),i=r?r.size:0,o=this.vr(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return ue.resolve(n?n.document.mutableCopy():Kt.newInvalidDocument(t))}getEntries(e,t){let n=Hn();return t.forEach(e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():Kt.newInvalidDocument(e))}),ue.resolve(n)}getDocumentsMatchingQuery(e,t,n,r){let i=Hn();const o=t.path,s=new $(o.child("")),a=this.docs.getIteratorFrom(s);for(;a.hasNext();){const{key:e,value:{document:s}}=a.getNext();if(!o.isPrefixOf(e.path))break;e.path.length>o.length+1||ie(ne(s),n)<=0||(r.has(s.key)||Fn(t,s))&&(i=i.insert(s.key,s.mutableCopy()))}return ue.resolve(i)}getAllFromCollectionGroup(e,t,n,r){b()}Fr(e,t){return ue.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new ps(this)}getSize(e){return ue.resolve(this.size)}}class ps extends Jo{constructor(e){super(),this.ar=e}applyChanges(e){const t=[];
vendor: 4,720 bytes, line 1
1return this.changes.forEach((n,r)=>{r.isValidDocument()?t.push(this.ar.addEntry(e,r)):this.ar.removeEntry(n)}),ue.waitFor(t)}getFromCache(e,t){return this.ar.getEntry(e,t)}getAllFromCache(e,t){return this.ar.getEntries(e,t)}}class ms{constructor(e){this.persistence=e,this.Mr=new Bn(e=>vn(e),bn),this.lastRemoteSnapshotVersion=V.min(),this.highestTargetId=0,this.Or=0,this.Nr=new cs,this.targetCount=0,this.Lr=Fo.Nn()}forEachTarget(e,t){return this.Mr.forEach((e,n)=>t(n)),ue.resolve()}getLastRemoteSnapshotVersion(e){return ue.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ue.resolve(this.Or)}allocateTargetId(e){return this.highestTargetId=this.Lr.next(),ue.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.Or&&(this.Or=t),ue.resolve()}qn(e){this.Mr.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.Lr=new Fo(t),this.highestTargetId=t),e.sequenceNumber>this.Or&&(this.Or=e.sequenceNumber)}addTargetData(e,t){return this.qn(t),this.targetCount+=1,ue.resolve()}updateTargetData(e,t){return this.qn(t),ue.resolve()}removeTargetData(e,t){return this.Mr.delete(t.target),this.Nr.Vr(t.targetId),this.targetCount-=1,ue.resolve()}removeTargets(e,t,n){let r=0;const i=[];return this.Mr.forEach((o,s)=>{s.sequenceNumber<=t&&null===n.get(s.targetId)&&(this.Mr.delete(o),i.push(this.removeMatchingKeysForTargetId(e,s.targetId)),r++)}),ue.waitFor(i).next(()=>r)}getTargetCount(e){return ue.resolve(this.targetCount)}getTargetData(e,t){const n=this.Mr.get(t)||null;return ue.resolve(n)}addMatchingKeys(e,t,n){return this.Nr.dr(t,n),ue.resolve()}removeMatchingKeys(e,t,n){this.Nr.Rr(t,n);const r=this.persistence.referenceDelegate,i=[];return r&&t.forEach(t=>{i.push(r.markPotentiallyOrphaned(e,t))}),ue.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this.Nr.Vr(t),ue.resolve()}getMatchingKeysForTargetId(e,t){const n=this.Nr.gr(t);return ue.resolve(n)}containsKey(e,t){return ue.resolve(this.Nr.containsKey(t))}}class gs{constructor(e,t){this.Br={},this.overlays={},this.kr=new we(0),this.qr=!1,this.qr=!0,this.referenceDelegate=e(this),this.Qr=new ms(this),this.indexManager=new wo,this.remoteDocumentCache=function(e){return new fs(e)}(e=>this.referenceDelegate.Kr(e)),this.serializer=new Ui(t),this.$r=new us(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.qr=!1,Promise.resolve()}get started(){return this.qr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new ls,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.Br[e.toKey()];return n||(n=new ds(t,this.referenceDelegate),this.Br[e.toKey()]=n),n}getTargetCache(){return this.Qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.$r}runTransaction(e,t,n){g("MemoryPersistence","Starting transaction:",e);const r=new _s(this.kr.next());return this.referenceDelegate.Ur(),n(r).next(e=>this.referenceDelegate.Wr(r).next(()=>e)).toPromise().then(e=>(r.raiseOnCommittedEvent(),e))}Gr(e,t){return ue.or(Object.values(this.Br).map(n=>()=>n.containsKey(e,t)))}}class _s extends se{constructor(e){super(),this.currentSequenceNumber=e}}class ys{constructor(e){this.persistence=e,this.zr=new cs,this.jr=null}static Hr(e){return new ys(e)}get Jr(){if(this.jr)return this.jr;throw b()}addReference(e,t,n){return this.zr.addReference(n,t),this.Jr.delete(n.toString()),ue.resolve()}removeReference(e,t,n){return this.zr.removeReference(n,t),this.Jr.add(n.toString()),ue.resolve()}markPotentiallyOrphaned(e,t){return this.Jr.add(t.toString()),ue.resolve()}removeTarget(e,t){this.zr.Vr(t.targetId).forEach(e=>this.Jr.add(e.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.Jr.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}Ur(){this.jr=new Set}Wr(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ue.forEach(this.Jr,n=>{const r=$.fromPath(n);return this.Yr(e,r).next(e=>{e||t.removeEntry(r,V.min())})}).next(()=>(this.jr=null,t.apply(e)))}updateLimboDocument(e,t){return this.Yr(e,t).next(e=>{e?this.Jr.delete(t.toString()):this.Jr.add(t.toString())})}Kr(e){return 0}Yr(e,t){return ue.or([()=>ue.resolve(this.zr.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Gr(e,t)])}}class vs{constructor(e,t){this.persistence=e,this.Zr=new Bn(e=>Se(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=Wo(this,t)}static Hr(e,t){return new vs(e,t)}Ur(){}Wr(e){return ue.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEac
1hTarget(e,t)}Hn(e){const t=this.Zn(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Zn(e){let t=0;return this.Jn(e,e=>{t++}).next(()=>t)}Jn(e,t){return ue.forEach(this.Zr,(n,r)=>this.er(e,n,r).next(e=>e?ue.resolve():t(r)))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0;const r=this.persistence.getRemoteDocumentCache(),i=r.newChangeBuffer();return r.Fr(e,r=>this.er(e,r,t).next(e=>{e||(n++,i.removeEntry(r,V.min()))})).next(()=>i.apply(e)).next(()=>n)}markPotentiallyOrphaned(e,t){return this.Zr.set(t,e.currentSequenceNumber),ue.resolve()}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.Zr.set(n,e.currentSequenceNumber),ue.resolve()}removeReference(e,t,n){return this.Zr.set(n,e.currentSequenceNumber),ue.resolve()}updateLimboDocument(e,t){return this.Zr.set(t,e.currentSequenceNumber),ue.resolve()}Kr(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=function e(t){switch(At(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const n=bt(t);return n?16+e(n):16;case 5:return 2*t.stringValue.length;case 6:return yt(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return function(t){return(t.values||[]).reduce((t,n)=>t+e(n),0)}(t.arrayValue);case 10:return function(t){let n=0;return nt(t.fields,(t,r)=>{n+=t.length+e(r)}),n}(t.mapValue);default:throw b()}}(e.data.value)),t}er(e,t,n){return ue.or([()=>this.persistence.Gr(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const e=this.Zr.get(t);return ue.resolve(void 0!==e&&e>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class bs{constructor(e){this.serializer=e}O(e,t,n,r){const i=new le("createOrUpgrade",t);n<1&&r>=1&&(function(e){e.createObjectStore("owner")}(e),function(e){e.createObjectStore("mutationQueues",{keyPath:"userId"}),e.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",xe,{unique:!0}),e.createObjectStore("documentMutations")}(e),ws(e),function(e){e.createObjectStore("remoteDocuments")}(e));let o=ue.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore("targetDocuments"),e.deleteObjectStore("targets"),e.deleteObjectStore("targetGlobal")}(e),ws(e)),o=o.next(()=>function(e){const t=e.store("targetGlobal"),n={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:V.min().toTimestamp(),targetCount:0};return t.put("targetGlobalKey",n)}(i))),n<4&&r>=4&&(0!==n&&(o=o.next(()=>function(e,t){return t.store("mutations").U().next(n=>{e.deleteObjectStore("mutations"),e.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",xe,{unique:!0});const r=t.store("mutations"),i=n.map(e=>r.put(e));return ue.waitFor(i)})}(e,i))),o=o.next(()=>{!function(e){e.createObjectStore("clientMetadata",{keyPath:"clientId"})}(e)})),n<5&&r>=5&&(o=o.next(()=>this.Xr(i))),n<6&&r>=6&&(o=o.next(()=>(function(e){e.createObjectStore("remoteDocumentGlobal")}(e),this.ei(i)))),n<7&&r>=7&&(o=o.next(()=>this.ti(i))),n<8&&r>=8&&(o=o.next(()=>this.ni(e,i))),n<9&&r>=9&&(o=o.next(()=>{!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e)})),n<10&&r>=10&&(o=o.next(()=>this.ri(i))),n<11&&r>=11&&(o=o.next(()=>{!function(e){e.createObjectStore("bundles",{keyPath:"bundleId"})}(e),function(e){e.createObjectStore("namedQueries",{keyPath:"name"})}(e)})),n<12&&r>=12&&(o=o.next(()=>{!function(e){const t=e.createObjectStore("documentOverlays",{keyPath:Ge});t.createIndex("collectionPathOverlayIndex",He,{unique:!1}),t.createIndex("collectionGroupOverlayIndex",Ke,{unique:!1})}(e)})),n<13&&r>=13&&(o=o.next(()=>function(e){const t=e.createObjectStore("remoteDocumentsV14",{keyPath:Re});t.createIndex("documentKeyIndex",Pe),t.createIndex("collectionGroupIndex",Le)}(e)).next(()=>this.ii(e,i)).next(()=>e.deleteObjectStore("remoteDocuments"))),n<14&&r>=14&&(o=o.next(()=>this.si(e,i))),n<15&&r>=15&&(o=o.next(()=>function(e){e.createObjectStore("indexConfiguration",{keyPath:"indexId",autoIncrement:!0}).createIndex("collectionGroupIndex","collectionGroup",{unique:!1}),e.createObjectStore("indexState",{keyPath:Ue}).createIndex("sequenceNumberIndex",ze,{unique:!1}),e.createObjectStore("indexEntries",{keyPath:Ve}).createIndex("documentKeyIndex",Be,{unique:!1})}(e))),n<16&&r>=16&&(o=o.next(()=>{t.objectStore("indexState").clear()}).next(()=>{t.objectStore("indexEntries").clear()}
1)),o}ei(e){let t=0;return e.store("remoteDocuments").J((e,n)=>{t+=Ro(n)}).next(()=>{const n={byteSize:t};return e.store("remoteDocumentGlobal").put("remoteDocumentGlobalKey",n)})}Xr(e){const t=e.store("mutationQueues"),n=e.store("mutations");return t.U().next(t=>ue.forEach(t,t=>{const r=IDBKeyRange.bound([t.userId,-1],[t.userId,t.lastAcknowledgedBatchId]);return n.U("userMutationsIndex",r).next(n=>ue.forEach(n,n=>{w(n.userId===t.userId);const r=Hi(this.serializer,n);return Oo(e,t.userId,r).next(()=>{})}))}))}ti(e){const t=e.store("targetDocuments"),n=e.store("remoteDocuments");return e.store("targetGlobal").get("targetGlobalKey").next(e=>{const r=[];return n.J((n,i)=>{const o=new G(n),s=function(e){return[0,Se(e)]}(o);r.push(t.get(s).next(n=>n?ue.resolve():(n=>t.put({targetId:0,path:Se(n),sequenceNumber:e.highestListenSequenceNumber}))(o)))}).next(()=>ue.waitFor(r))})}ni(e,t){e.createObjectStore("collectionParents",{keyPath:Fe});const n=t.store("collectionParents"),r=new Io,i=e=>{if(r.add(e)){const t=e.lastSegment(),r=e.popLast();return n.put({collectionId:t,parent:Se(r)})}};return t.store("remoteDocuments").J({H:!0},(e,t)=>{const n=new G(e);return i(n.popLast())}).next(()=>t.store("documentMutations").J({H:!0},([e,t,n],r)=>{const o=ke(t);return i(o.popLast())}))}ri(e){const t=e.store("targets");return t.J((e,n)=>{const r=Ki(n),i=$i(this.serializer,r);return t.put(i)})}ii(e,t){const n=t.store("remoteDocuments"),r=[];return n.J((e,n)=>{const i=t.store("remoteDocumentsV14"),o=function(e){return e.document?new $(G.fromString(e.document.name).popFirst(5)):e.noDocument?$.fromSegments(e.noDocument.path):e.unknownDocument?$.fromSegments(e.unknownDocument.path):b()}(n).path.toArray(),s={prefixPath:o.slice(0,o.length-2),collectionGroup:o[o.length-2],documentId:o[o.length-1],readTime:n.readTime||[0,0],unknownDocument:n.unknownDocument,noDocument:n.noDocument,document:n.document,hasCommittedMutations:!!n.hasCommittedMutations};r.push(i.put(s))}).next(()=>ue.waitFor(r))}si(e,t){const n=t.store("mutations"),r=Zo(this.serializer),i=new gs(ys.Hr,this.serializer.ct);return n.U().next(e=>{const n=new Map;return e.forEach(e=>{var t;let r=null!==(t=n.get(e.userId))&&void 0!==t?t:er();Hi(this.serializer,e).keys().forEach(e=>r=r.add(e)),n.set(e.userId,r)}),ue.forEach(n,(e,n)=>{const o=new h(n),s=to.lt(this.serializer,o),a=i.getIndexManager(o),u=Po.lt(o,this.serializer,a,i.referenceDelegate);return new as(r,u,s,a).recalculateAndSaveOverlaysForDocumentKeys(new Ze(t,we.oe),e).next()})})}}function ws(e){e.createObjectStore("targetDocuments",{keyPath:qe}).createIndex("documentTargetsIndex",Me,{unique:!0}),e.createObjectStore("targets",{keyPath:"targetId"}).createIndex("queryTargetsIndex",je,{unique:!0}),e.createObjectStore("targetGlobal")}const Is="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";class Ts{constructor(e,t,n,r,i,o,s,a,u,l,c=16){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=n,this.oi=i,this.window=o,this.document=s,this._i=u,this.ai=l,this.ui=c,this.kr=null,this.qr=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ci=null,this.inForeground=!1,this.li=null,this.hi=null,this.Pi=Number.NEGATIVE_INFINITY,this.Ii=e=>Promise.resolve(),!Ts.D())throw new S(E.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new Qo(this,r),this.Ti=t+"main",this.serializer=new Ui(a),this.Ei=new ce(this.Ti,this.ui,new bs(this.serializer)),this.Qr=new Uo(this.referenceDelegate,this.serializer),this.remoteDocumentCache=Zo(this.serializer),this.$r=new Xi,this.window&&this.window.localStorage?this.di=this.window.localStorage:(this.di=null,!1===l&&_("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Ai().then(()=>
1{if(!this.isPrimary&&!this.allowTabSynchronization)throw new S(E.FAILED_PRECONDITION,Is);return this.Ri(),this.Vi(),this.mi(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.Qr.getHighestSequenceNumber(e))}).then(e=>{this.kr=new we(e,this._i)}).then(()=>{this.qr=!0}).catch(e=>(this.Ei&&this.Ei.close(),Promise.reject(e)))}fi(e){return this.Ii=async t=>{if(this.started)return e(t)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.Ei.L(async t=>{null===t.newVersion&&await e()})}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.oi.enqueueAndForget(async()=>{this.started&&await this.Ai()}))}Ai(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>Ss(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.gi(e).next(e=>{e||(this.isPrimary=!1,this.oi.enqueueRetryable(()=>this.Ii(!1)))})}).next(()=>this.pi(e)).next(t=>this.isPrimary&&!t?this.yi(e).next(()=>!1):!!t&&this.wi(e).next(()=>!0))).catch(e=>{if(pe(e))return g("IndexedDbPersistence","Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return g("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.oi.enqueueRetryable(()=>this.Ii(e)),this.isPrimary=e})}gi(e){return Es(e).get("owner").next(e=>ue.resolve(this.Si(e)))}bi(e){return Ss(e).delete(this.clientId)}async Di(){if(this.isPrimary&&!this.Ci(this.Pi,18e5)){this.Pi=Date.now();const e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",e=>{const t=et(e,"clientMetadata");return t.U().next(e=>{const n=this.vi(e,18e5),r=e.filter(e=>-1===n.indexOf(e));return ue.forEach(r,e=>t.delete(e.clientId)).next(()=>r)})}).catch(()=>[]);if(this.di)for(const t of e)this.di.removeItem(this.Fi(t.clientId))}}mi(){this.hi=this.oi.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.Ai().then(()=>this.Di()).then(()=>this.mi()))}Si(e){return!!e&&e.ownerId===this.clientId}pi(e){return this.ai?ue.resolve(!0):Es(e).get("owner").next(t=>{if(null!==t&&this.Ci(t.leaseTimestampMs,5e3)&&!this.Mi(t.ownerId)){if(this.Si(t)&&this.networkEnabled)return!0;if(!this.Si(t)){if(!t.allowTabSynchronization)throw new S(E.FAILED_PRECONDITION,Is);return!1}}return!(!this.networkEnabled||!this.inForeground)||Ss(e).U().next(e=>void 0===this.vi(e,5e3).find(e=>{if(this.clientId!==e.clientId){const t=!this.networkEnabled&&e.networkEnabled,n=!this.inForeground&&e.inForeground,r=this.networkEnabled===e.networkEnabled;if(t||n&&r)return!0}return!1}))}).next(e=>(this.isPrimary!==e&&g("IndexedDbPersistence",`Client ${e?"is":"is not"} eligible for a primary lease.`),e))}async shutdown(){this.qr=!1,this.xi(),this.hi&&(this.hi.cancel(),this.hi=null),this.Oi(),this.Ni(),await this.Ei.runTransaction("shutdown","readwrite",["owner","clientMetadata"],e=>{const t=new Ze(e,we.oe);return this.yi(t).next(()=>this.bi(t))}),this.Ei.close(),this.Li()}vi(e,t){return e.filter(e=>this.Ci(e.updateTimeMs,t)&&!this.Mi(e.clientId))}Bi(){return this.runTransaction("getActiveClients","readonly",e=>Ss(e).U().next(e=>this.vi(e,18e5).map(e=>e.clientId)))}get started(){return this.qr}getMutationQueue(e,t){return Po.lt(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.Qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new Eo(e,this.serializer.ct.databaseId)}getDocumentOverlayCache(e){return to.lt(this.serializer,e)}getBundleCache(){return this.$r}runTransaction(e,t,n){g("IndexedDbPersistence","Starting transaction:",e);const r="readonly"===t?"readonly":"readwrite",i=function(e){return 16===e?Xe:15===e?Je:14===e?Ye:13===e?Qe:12===e?We:11===e?$e:void b()}(this.ui);let o;return this.Ei.runTransaction(e,r,i,r=>(o=new Ze(r,this.kr?this.kr.next():we.oe),"readwrite-primary"===t?this.gi(o).next(e=>!!e||this.pi(o)).next(t=>{if(!t)throw _(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.oi.enqueueRetryable(()=>this.Ii(!1)),new S(E.FAILED_PRECONDITION,oe);return n(o)}).next(e=>this.wi(o).next(()=>e)):this.ki(o).next(()=>n(o)))).then(e=>(o.raiseOnCommittedEvent(),e))}ki(e){return Es(e).get("owner").next(e=>{if(null!==e&&this.Ci(e.leaseTimestampMs,5e3)&&!this.Mi(e.ownerId)&&!this.Si(e)&&!(this.ai||this.allowTabSynchronization&&e.allowTabSynchronization))throw new S(E.FAILED_PRECONDITION,Is)})}wi(e){const t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return Es(e).put("owner",t)}static D(){return ce.D()}yi(e){const t=Es(e);return t.get("owner").next(e=>this.Si(e)?(g("IndexedDbPersistence","Releasing primary lease."),t.delete("owner")):ue.resolve())}Ci(e,t){const n=Date.now();return!(e<n-t||e>n&&(_(`Detected an update time that is in the future: ${e} > ${n}`),1))}Ri(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.li=()=>{this.oi.enqueueAndForget(()=>(this.inForeground="visible"===this.document.visibilityState,this.Ai()))},this.document.addEventListener("visibilitychange",this.li),this.inForeground="visible"===this.document.visibilityState)}Oi(){this.li&&(this.document.removeEventListener("visibilitychange",this.li),this.li=null)}Vi(){var e;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.ci=()=>{this.xi();const e=/(?:Version|Mobile)\/1[456]/;Object(a.z)()&&(navigator.appVersion.match(e)||navigator.userAgent.match(e))&&this.oi.enterRestrictedMode(!0),this.oi.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.ci))}Ni(){this.ci&&(this.window.removeEventListener("pagehide",this.ci),this.ci=null)}Mi(e){var t;try{const n=null!==(null===(t=this.di)||void 0===t?void 0:t.getItem(this.Fi(e)));return g("IndexedDbPersistence",`Client '${e}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(e){return _("IndexedDbPersistence","Failed to get zombied client id.",e),!1}}xi(){if(this.di)try{this.di.setItem(this.Fi(this.clientId),String(Date.now()))}catch(e){_("Failed to set zombie client id.",e)}}Li(){if(this.di)try{this.di.removeItem(this.Fi(this.clientId))}catch(e){}}Fi(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function Es(e){return et(e,"owner")}function Ss(e){return et(e,"clientMetadata")}function As(e,t){let n=e.projectId;return e.isDefaultDatabase||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}class Cs{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.qi=n,this.Qi=r}static Ki(e,t){let n=er(),r=er();for(const e of t.docChanges)switch(e.type){case 0:n=n.add(e.doc.key);break;case 1:r=r.add(e.doc.key)}return new Cs(e,t.fromCache,n,r)}}class ks{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class xs{constructor(){this.$i=!1,this.Ui=!1,this.Wi=100,this.Gi=Object(a.z)()?8:he(Object(a.q)())>0?6:4}initialize(e,t){this.zi=e,this.indexManager=t,this.$i=!0}getDocumentsMatchingQuery(e,t,n,r){const i={result:null};return this.ji(e,t).next(e=>{i.result=e}).next(()=>{if(!i.result)return this.Hi(e,t,r,n).next(e=>{i.result=e})}).next(()=>{if(i.result)return;const n=new ks;
1return this.Ji(e,t,n).next(r=>{if(i.result=r,this.Ui)return this.Yi(e,t,n,r.size)})}).next(()=>i.result)}Yi(e,t,n,r){return n.documentReadCount<this.Wi?(p()<=s.a.DEBUG&&g("QueryEngine","SDK will not create cache indexes for query:",Mn(t),"since it only creates cache indexes for collection contains","more than or equal to",this.Wi,"documents"),ue.resolve()):(p()<=s.a.DEBUG&&g("QueryEngine","Query:",Mn(t),"scans",n.documentReadCount,"local documents and returns",r,"documents as results."),n.documentReadCount>this.Gi*r?(p()<=s.a.DEBUG&&g("QueryEngine","The SDK decides to create cache indexes for query:",Mn(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Dn(t))):ue.resolve())}ji(e,t){if(kn(t))return ue.resolve(null);let n=Dn(t);return this.indexManager.getIndexType(e,n).next(r=>0===r?null:(null!==t.limit&&1===r&&(t=Ln(t,null,"F"),n=Dn(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next(r=>{const i=er(...r);return this.zi.getDocuments(e,i).next(r=>this.indexManager.getMinOffset(e,n).next(n=>{const o=this.Zi(t,r);return this.Xi(t,o,i,n.readTime)?this.ji(e,Ln(t,null,"F")):this.es(e,o,t,n)}))})))}Hi(e,t,n,r){return kn(t)||r.isEqual(V.min())?ue.resolve(null):this.zi.getDocuments(e,n).next(i=>{const o=this.Zi(t,i);return this.Xi(t,o,n,r)?ue.resolve(null):(p()<=s.a.DEBUG&&g("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),Mn(t)),this.es(e,o,t,te(r,-1)).next(e=>e))})}Zi(e,t){let n=new ut(zn(e));return t.forEach((t,r)=>{Fn(e,r)&&(n=n.add(r))}),n}Xi(e,t,n,r){if(null===e.limit)return!1;if(n.size!==t.size)return!0;const i="F"===e.limitType?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}Ji(e,t,n){return p()<=s.a.DEBUG&&g("QueryEngine","Using full collection scan to execute query:",Mn(t)),this.zi.getDocumentsMatchingQuery(e,t,re.min(),n)}es(e,t,n,r){return this.zi.getDocumentsMatchingQuery(e,n,r).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}class Ns{constructor(e,t,n,r){this.persistence=e,this.ts=t,this.serializer=r,this.ns=new ot(M),this.rs=new Bn(e=>vn(e),bn),this.ss=new Map,this.os=e.getRemoteDocumentCache(),this.Qr=e.getTargetCache(),this.$r=e.getBundleCache(),this._s(n)}_s(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new as(this.os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.os.setIndexManager(this.indexManager),this.ts.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.ns))}}function Ds(e,t,n,r){return new Ns(e,t,n,r)}async function Os(e,t){const n=T(e);return await n.persistence.runTransaction("Handle user change","readonly",e=>{let r;
1return n.mutationQueue.getAllMutationBatches(e).next(i=>(r=i,n._s(t),n.mutationQueue.getAllMutationBatches(e))).next(t=>{const i=[],o=[];let s=er();for(const e of r){i.push(e.batchId);for(const t of e.mutations)s=s.add(t.key)}for(const e of t){o.push(e.batchId);for(const t of e.mutations)s=s.add(t.key)}return n.localDocuments.getDocuments(e,s).next(e=>({us:e,removedBatchIds:i,addedBatchIds:o}))})})}function Rs(e){const t=T(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.Qr.getLastRemoteSnapshotVersion(e))}function Ps(e,t,n){let r=er(),i=er();return n.forEach(e=>r=r.add(e)),t.getEntries(e,r).next(e=>{let r=Hn();return n.forEach((n,o)=>{const s=e.get(n);o.isFoundDocument()!==s.isFoundDocument()&&(i=i.add(n)),o.isNoDocument()&&o.version.isEqual(V.min())?(t.removeEntry(n,o.readTime),r=r.insert(n,o)):!s.isValidDocument()||o.version.compareTo(s.version)>0||0===o.version.compareTo(s.version)&&s.hasPendingWrites?(t.addEntry(o),r=r.insert(n,o)):g("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",o.version)}),{cs:r,ls:i}})}function Ls(e,t){const n=T(e);return n.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}function js(e,t){const n=T(e);return n.persistence.runTransaction("Allocate target","readwrite",e=>{let r;return n.Qr.getTargetData(e,t).next(i=>i?(r=i,ue.resolve(r)):n.Qr.allocateTargetId(e).next(i=>(r=new Fi(t,i,"TargetPurposeListen",e.currentSequenceNumber),n.Qr.addTargetData(e,r).next(()=>r))))}).then(e=>{const r=n.ns.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.ns=n.ns.insert(e.targetId,e),n.rs.set(t,e.targetId)),e})}async function qs(e,t,n){const r=T(e),i=r.ns.get(t),o=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",o,e=>r.persistence.referenceDelegate.removeTarget(e,i))}catch(e){if(!pe(e))throw e;g("LocalStore",`Failed to update sequence numbers for target ${t}: ${e}`)}r.ns=r.ns.remove(t),r.rs.delete(i.target)}function Ms(e,t,n){const r=T(e);let i=V.min(),o=er();return r.persistence.runTransaction("Execute query","readwrite",e=>function(e,t,n){const r=T(e),i=r.rs.get(n);return void 0!==i?ue.resolve(r.ns.get(i)):r.Qr.getTargetData(t,n)}(r,e,Dn(t)).next(t=>{if(t)return i=t.lastLimboFreeSnapshotVersion,r.Qr.getMatchingKeysForTargetId(e,t.targetId).next(e=>{o=e})}).next(()=>r.ts.getDocumentsMatchingQuery(e,t,n?i:V.min(),n?o:er())).next(e=>(zs(r,Un(t),e),{documents:e,hs:o})))}function Fs(e,t){const n=T(e),r=T(n.Qr),i=n.ns.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",e=>r.ot(e,t).next(e=>e?e.target:null))}function Us(e,t){const n=T(e),r=n.ss.get(t)||V.min();return n.persistence.runTransaction("Get new document changes","readonly",e=>n.os.getAllFromCollectionGroup(e,t,te(r,-1),Number.MAX_SAFE_INTEGER)).then(e=>(zs(n,t,e),e))}function zs(e,t,n){let r=e.ss.get(t)||V.min();n.forEach((e,t)=>{t.readTime.compareTo(r)>0&&(r=t.readTime)}),e.ss.set(t,r)}async function Vs(e,t,n=er()){const r=await js(e,Dn(Wi(t.bundledQuery))),i=T(e);return i.persistence.runTransaction("Save named query","readwrite",e=>{const o=pi(t.readTime);if(r.snapshotVersion.compareTo(o)>=0)return i.$r.saveNamedQuery(e,t);const s=r.withResumeToken(pt.EMPTY_BYTE_STRING,o);return i.ns=i.ns.insert(s.targetId,s),i.Qr.updateTargetData(e,s).next(()=>i.Qr.removeMatchingKeysForTargetId(e,r.targetId)).next(()=>i.Qr.addMatchingKeys(e,n,r.targetId)).next(()=>i.$r.saveNamedQuery(e,t))})}function Bs(e,t){return`firestore_clients_${e}_${t}`}function Gs(e,t,n){let r=`firestore_mutations_${e}_${n}`;return t.isAuthenticated()&&(r+="_"+t.uid),r}function Hs(e,t){return`firestore_targets_${e}_${t}`}class Ks{constructor(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}static Es(e,t,n){const r=JSON.parse(n);let i,o="object"==typeof r&&-1!==["pending","acknowledged","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return o&&r.error&&(o="string"==typeof r.error.message&&"string"==typeof r.error.code,o&&(i=new S(r.error.code,r.error.message))),o?new Ks(e,t,r.state,i):(_("SharedCl
1ientState",`Failed to parse mutation state for ID '${t}': ${n}`),null)}ds(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class $s{constructor(e,t,n){this.targetId=e,this.state=t,this.error=n}static Es(e,t){const n=JSON.parse(t);let r,i="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return i&&n.error&&(i="string"==typeof n.error.message&&"string"==typeof n.error.code,i&&(r=new S(n.error.code,n.error.message))),i?new $s(e,n.state,r):(_("SharedClientState",`Failed to parse target state for ID '${e}': ${t}`),null)}ds(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class Ws{constructor(e,t){this.clientId=e,this.activeTargetIds=t}static Es(e,t){const n=JSON.parse(t);let r="object"==typeof n&&n.activeTargetIds instanceof Array,i=nr();for(let e=0;r&&e<n.activeTargetIds.length;++e)r=Ee(n.activeTargetIds[e]),i=i.add(n.activeTargetIds[e]);return r?new Ws(e,i):(_("SharedClientState",`Failed to parse client data for instance '${e}': ${t}`),null)}}class Qs{constructor(e,t){this.clientId=e,this.onlineState=t}static Es(e){const t=JSON.parse(e);return"object"==typeof t&&-1!==["Unknown","Online","Offline"].indexOf(t.onlineState)&&"string"==typeof t.clientId?new Qs(t.clientId,t.onlineState):(_("SharedClientState","Failed to parse online state: "+e),null)}}class Ys{constructor(){this.activeTargetIds=nr()}As(e){this.activeTargetIds=this.activeTargetIds.add(e)}Rs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}ds(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Js{constructor(e,t,n,r,i){this.window=e,this.oi=t,this.persistenceKey=n,this.Vs=r,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.fs=this.gs.bind(this),this.ps=new ot(M),this.started=!1,this.ys=[];const o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.ws=Bs(this.persistenceKey,this.Vs),this.Ss=function(e){return"firestore_sequence_number_"+e}(this.persistenceKey),this.ps=this.ps.insert(this.Vs,new Ys),this.bs=new RegExp(`^firestore_clients_${o}_([^_]*)$`),this.Ds=new RegExp(`^firestore_mutations_${o}_(\\d+)(?:_(.*))?$`),this.Cs=new RegExp(`^firestore_targets_${o}_(\\d+)$`),this.vs=function(e){return"firestore_online_state_"+e}(this.persistenceKey),this.Fs=function(e){return"firestore_bundle_loaded_v2_"+e}(this.persistenceKey),this.window.addEventListener("storage",this.fs)}static D(e){return!(!e||!e.localStorage)}async start(){const e=await this.syncEngine.Bi();for(const t of e){if(t===this.Vs)continue;const e=this.getItem(Bs(this.persistenceKey,t));if(e){const n=Ws.Es(t,e);n&&(this.ps=this.ps.insert(n.clientId,n))}}this.Ms();const t=this.storage.getItem(this.vs);if(t){const e=this.xs(t);e&&this.Os(e)}for(const e of this.ys)this.gs(e);this.ys=[],this.window.addEventListener("pagehide",()=>this.shutdown()),this.started=!0}writeSequenceNumber(e){this.setItem(this.Ss,JSON.stringify(e))}getAllActiveQueryTargets(){return this.Ns(this.ps)}isActiveQueryTarget(e){let t=!1;return this.ps.forEach((n,r)=>{r.activeTargetIds.has(e)&&(t=!0)}),t}addPendingMutation(e){this.Ls(e,"pending")}updateMutationState(e,t,n){this.Ls(e,t,n),this.Bs(e)}addLocalQueryTarget(e){let t="not-current";if(this.isActiveQueryTarget(e)){const n=this.storage.getItem(Hs(this.persistenceKey,e));if(n){const r=$s.Es(e,n);r&&(t=r.state)}}return this.ks.As(e),this.Ms(),t}removeLocalQueryTarget(e){this.ks.Rs(e),this.Ms()}isLocalQueryTarget(e){return this.ks.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(Hs(this.persistenceKey,e))}updateQueryState(e,t,n){this.qs(e,t,n)}handleUserChange(e,t,n){t.forEach(e=>{this.Bs(e)}),this.currentUser=e,n.forEach(e=>{this.addPendingMutation(e)})}setOnlineState(e){this.Qs(e)}notifyBundleLoaded(e){this.Ks(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.fs),this.removeItem(this.ws),this.started=!1)}getItem(e){const t=this.storage.getItem(e);
1return g("SharedClientState","READ",e,t),t}setItem(e,t){g("SharedClientState","SET",e,t),this.storage.setItem(e,t)}removeItem(e){g("SharedClientState","REMOVE",e),this.storage.removeItem(e)}gs(e){const t=e;if(t.storageArea===this.storage){if(g("SharedClientState","EVENT",t.key,t.newValue),t.key===this.ws)return void _("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.oi.enqueueRetryable(async()=>{if(this.started){if(null!==t.key)if(this.bs.test(t.key)){if(null==t.newValue){const e=this.$s(t.key);return this.Us(e,null)}{const e=this.Ws(t.key,t.newValue);if(e)return this.Us(e.clientId,e)}}else if(this.Ds.test(t.key)){if(null!==t.newValue){const e=this.Gs(t.key,t.newValue);if(e)return this.zs(e)}}else if(this.Cs.test(t.key)){if(null!==t.newValue){const e=this.js(t.key,t.newValue);if(e)return this.Hs(e)}}else if(t.key===this.vs){if(null!==t.newValue){const e=this.xs(t.newValue);if(e)return this.Os(e)}}else if(t.key===this.Ss){const e=function(e){let t=we.oe;if(null!=e)try{const n=JSON.parse(e);w("number"==typeof n),t=n}catch(e){_("SharedClientState","Failed to read sequence number from WebStorage",e)}return t}(t.newValue);e!==we.oe&&this.sequenceNumberHandler(e)}else if(t.key===this.Fs){const e=this.Js(t.newValue);await Promise.all(e.map(e=>this.syncEngine.Ys(e)))}}else this.ys.push(t)})}}get ks(){return this.ps.get(this.Vs)}Ms(){this.setItem(this.ws,this.ks.ds())}Ls(e,t,n){const r=new Ks(this.currentUser,e,t,n),i=Gs(this.persistenceKey,this.currentUser,e);this.setItem(i,r.ds())}Bs(e){const t=Gs(this.persistenceKey,this.currentUser,e);this.removeItem(t)}Qs(e){const t={clientId:this.Vs,onlineState:e};this.storage.setItem(this.vs,JSON.stringify(t))}qs(e,t,n){const r=Hs(this.persistenceKey,e),i=new $s(e,t,n);this.setItem(r,i.ds())}Ks(e){const t=JSON.stringify(Array.from(e));this.setItem(this.Fs,t)}$s(e){const t=this.bs.exec(e);return t?t[1]:null}Ws(e,t){const n=this.$s(e);return Ws.Es(n,t)}Gs(e,t){const n=this.Ds.exec(e),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return Ks.Es(new h(i),r,t)}js(e,t){const n=this.Cs.exec(e),r=Number(n[1]);return $s.Es(r,t)}xs(e){return Qs.Es(e)}Js(e){return JSON.parse(e)}async zs(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.Zs(e.batchId,e.state,e.error);g("SharedClientState","Ignoring mutation for non-active user "+e.user.uid)}Hs(e){return this.syncEngine.Xs(e.targetId,e.state,e.error)}Us(e,t){const n=t?this.ps.insert(e,t):this.ps.remove(e),r=this.Ns(this.ps),i=this.Ns(n),o=[],s=[];return i.forEach(e=>{r.has(e)||o.push(e)}),r.forEach(e=>{i.has(e)||s.push(e)}),this.syncEngine.eo(o,s).then(()=>{this.ps=n})}Os(e){this.ps.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}Ns(e){let t=nr();return e.forEach((e,n)=>{t=t.unionWith(n.activeTargetIds)}),t}}class Xs{constructor(){this.no=new Ys,this.ro={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return this.no.As(e),this.ro[e]||"not-current"}updateQueryState(e,t,n){this.ro[e]=t}removeLocalQueryTarget(e){this.no.Rs(e)}isLocalQueryTarget(e){return this.no.activeTargetIds.has(e)}clearQueryState(e){delete this.ro[e]}getAllActiveQueryTargets(){return this.no.activeTargetIds}isActiveQueryTarget(e){return this.no.activeTargetIds.has(e)}start(){return this.no=new Ys,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class Zs{io(e){}shutdown(){}}class ea{constructor(){this.so=()=>this.oo(),this._o=()=>this.ao(),this.uo=[],this.co()}io(e){this.uo.push(e)}shutdown(){window.removeEventListener("online",this.so),window.removeEventListener("offline",this._o)}co(){window.addEventListener("online",this.so),window.addEventListener("offline",this._o)}oo(){g("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.uo)e(0)}ao(){g("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.uo)e(1)}static D(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let ta=null;function na(){return null===ta?ta=268435456+Math.round(2147483648*Math.random()):ta++,"0x"+ta.toString(16)}const ra={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregation
1Query:"runAggregationQuery"};class ia{constructor(e){this.lo=e.lo,this.ho=e.ho}Po(e){this.Io=e}To(e){this.Eo=e}Ao(e){this.Ro=e}onMessage(e){this.Vo=e}close(){this.ho()}send(e){this.lo(e)}mo(){this.Io()}fo(){this.Eo()}po(e){this.Ro(e)}yo(e){this.Vo(e)}}const oa="WebChannelConnection";class sa extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),r=encodeURIComponent(this.databaseId.database);this.wo=t+"://"+e.host,this.So=`projects/${n}/databases/${r}`,this.bo="(default)"===this.databaseId.database?"project_id="+n:`project_id=${n}&database_id=${r}`}get Do(){return!1}Co(e,t,n,r,i){const o=na(),s=this.vo(e,t.toUriEncodedString());g("RestConnection",`Sending RPC '${e}' ${o}:`,s,n);const a={"google-cloud-resource-prefix":this.So,"x-goog-request-params":this.bo};return this.Fo(a,r,i),this.Mo(e,s,a,n).then(t=>(g("RestConnection",`Received RPC '${e}' ${o}: `,t),t),t=>{throw y("RestConnection",`RPC '${e}' ${o} failed with error: `,t,"url: ",s,"request:",n),t})}xo(e,t,n,r,i,o){return this.Co(e,t,n,r,i)}Fo(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+d,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t)}vo(e,t){const n=ra[e];return`${this.wo}/v1/${t}:${n}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Mo(e,t,n,r){const i=na();return new Promise((o,s)=>{const a=new l.g;a.setWithCredentials(!0),a.listenOnce(l.c.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case l.a.NO_ERROR:const t=a.getResponseJson();g(oa,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),o(t);break;case l.a.TIMEOUT:g(oa,`RPC '${e}' ${i} timed out`),s(new S(E.DEADLINE_EXCEEDED,"Request time out"));break;case l.a.HTTP_ERROR:const n=a.getStatus();if(g(oa,`RPC '${e}' ${i} failed with status:`,n,"response text:",a.getResponseText()),n>0){let e=a.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=null==e?void 0:e.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(E).indexOf(t)>=0?t:E.UNKNOWN}(t.status);s(new S(e,t.message))}else s(new S(E.UNKNOWN,"Server responded with status "+a.getStatus()))}else s(new S(E.UNAVAILABLE,"Connection failed."));break;default:b()}}finally{g(oa,`RPC '${e}' ${i} completed.`)}});const u=JSON.stringify(r);g(oa,`RPC '${e}' ${i} sending request:`,r),a.send(t,"POST",u,n,15)})}Oo(e,t,n){const r=na(),i=[this.wo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=Object(l.h)(),s=Object(l.i)(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},u=this.longPollingOptions.timeoutSeconds;void 0!==u&&(a.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(a.xmlHttpFactory=new l.d({})),this.Fo(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;const c=i.join("");g(oa,`Creating RPC '${e}' stream ${r}: ${c}`,a);const h=o.createWebChannel(c,a);let d=!1,f=!1;const p=new ia({lo:t=>{f?g(oa,`Not sending because RPC '${e}' stream ${r} is closed:`,t):(d||(g(oa,`Opening RPC '${e}' stream ${r} transport.`),h.open(),d=!0),g(oa,`RPC '${e}' stream ${r} sending:`,t),h.send(t))},ho:()=>h.close()}),m=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(e){setTimeout(()=>{throw e},0)}})};return m(h,l.f.EventType.OPEN,()=>{f||(g(oa,`RPC '${e}' stream ${r} transport opened.`),p.mo())}),m(h,l.f.EventType.CLOSE,()=>{f||(f=!0,g(oa,`RPC '${e}' stream ${r} transport closed`),p.po())}),m(h,l.f.EventType.ERROR,t=>{f||(f=!0,y(oa,`RPC '${e}' stream ${r} transport errored:`,t),p.po(new S(E.UNAVAILABLE,"The operation could not be completed")))}),m(h,l.f.EventType.MESSAGE,t=>{var n;if(!f){const i=t.data[0];w(!!i);const o=i,s=o.error||(null===(n=o[0])||void 0===n?void 0:n.error);if(s){g(oa,`RPC '${e}' stream ${r} received error:`,s);const t=s.status;let n=function(e){const t=Ur[e];if(void 0!==t)return Br(t)}(t),i=s.message;void 0===n&&(n=E.INTERNAL,i="Unknown error status: "+t+" with message "+s.message),f=!0,p.po(new S(n,i)),h.close()}else g(oa,`RPC '${e}' stream ${r} received:`,i),p.yo(i)}}),m(s,l.b.STAT_EVENT,t=>{t.stat===l.e.PROXY?g(oa,`RPC '${e}' stream ${r} detected buffering proxy`):t.stat===l.e.NOPROXY&&g(oa,`RPC '${e}' stream ${r} detected no buffering proxy`)}),setTimeout(()=>{p.fo()},0),p}}function aa(){return"undefined"!=typeof window?window:null}function ua(){return"undefined"!=typeof document?document:null}function la(e){return new li(e,!0)}class ca{constructor(e,t,n=1e3,r=1.5,i=6e4){this.oi=e,this.timerId=t,this.No=n,this.Lo=r,this.Bo=i,this.ko=0,this.qo=null,this.Qo=Date.now(),this.reset()}reset(){this.ko=0}Ko(){this.ko=this.Bo}$o(e){this.cancel();const t=Math.floor(this.ko+this.Uo()),n=Math.max(0,Date.now()-this.Qo),r=Math.max(0,t-n);r>0&&g("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.ko}
1 ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.qo=this.oi.enqueueAfterDelay(this.timerId,r,()=>(this.Qo=Date.now(),e())),this.ko*=this.Lo,this.ko<this.No&&(this.ko=this.No),this.ko>this.Bo&&(this.ko=this.Bo)}Wo(){null!==this.qo&&(this.qo.skipDelay(),this.qo=null)}cancel(){null!==this.qo&&(this.qo.cancel(),this.qo=null)}Uo(){return(Math.random()-.5)*this.ko}}class ha{constructor(e,t,n,r,i,o,s,a){this.oi=e,this.Go=n,this.zo=r,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=s,this.listener=a,this.state=0,this.jo=0,this.Ho=null,this.Jo=null,this.stream=null,this.Yo=new ca(e,t)}Zo(){return 1===this.state||5===this.state||this.Xo()}Xo(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.e_()}async stop(){this.Zo()&&await this.close(0)}t_(){this.state=0,this.Yo.reset()}n_(){this.Xo()&&null===this.Ho&&(this.Ho=this.oi.enqueueAfterDelay(this.Go,6e4,()=>this.r_()))}i_(e){this.s_(),this.stream.send(e)}async r_(){if(this.Xo())return this.close(0)}s_(){this.Ho&&(this.Ho.cancel(),this.Ho=null)}o_(){this.Jo&&(this.Jo.cancel(),this.Jo=null)}async close(e,t){this.s_(),this.o_(),this.Yo.cancel(),this.jo++,4!==e?this.Yo.reset():t&&t.code===E.RESOURCE_EXHAUSTED?(_(t.toString()),_("Using maximum backoff delay to prevent overloading the backend."),this.Yo.Ko()):t&&t.code===E.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.__(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Ao(t)}__(){}auth(){this.state=1;const e=this.a_(this.jo),t=this.jo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,n])=>{this.jo===t&&this.u_(e,n)},t=>{e(()=>{const e=new S(E.UNKNOWN,"Fetching auth token failed: "+t.message);return this.c_(e)})})}u_(e,t){const n=this.a_(this.jo);this.stream=this.l_(e,t),this.stream.Po(()=>{n(()=>this.listener.Po())}),this.stream.To(()=>{n(()=>(this.state=2,this.Jo=this.oi.enqueueAfterDelay(this.zo,1e4,()=>(this.Xo()&&(this.state=3),Promise.resolve())),this.listener.To()))}),this.stream.Ao(e=>{n(()=>this.c_(e))}),this.stream.onMessage(e=>{n(()=>this.onMessage(e))})}e_(){this.state=5,this.Yo.$o(async()=>{this.state=0,this.start()})}c_(e){return g("PersistentStream","close with error: "+e),this.stream=null,this.close(4,e)}a_(e){return t=>{this.oi.enqueueAndForget(()=>this.jo===e?t():(g("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class da extends ha{constructor(e,t,n,r,i,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,r,o),this.serializer=i}l_(e,t){return this.connection.Oo("Listen",e,t)}onMessage(e){this.Yo.reset();const t=function(e,t){let n;if("targetChange"in t){t.targetChange;const i=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:b()}(t.targetChange.targetChangeType||"NO_CHANGE"),o=t.targetChange.targetIds||[],s=function(e,t){return e.useProto3Json?(w(void 0===t||"string"==typeof t),pt.fromBase64String(t||"")):(w(void 0===t||t instanceof r||t instanceof Uint8Array),pt.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),a=t.targetChange.cause,u=a&&function(e){const t=void 0===e.code?E.UNKNOWN:Br(e.code);return new S(t,e.message||"")}(a);n=new ti(i,o,s,u||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const i=vi(e,r.document.name),o=pi(r.document.updateTime),s=r.document.createTime?pi(r.document.createTime):V.min(),a=new Gt({mapValue:{fields:r.document.fields}}),u=Kt.newFoundDocument(i,o,s,a),l=r.targetIds||[],c=r.removedTargetIds||[];n=new Zr(l,c,u.key,u)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const i=vi(e,r.document),o=r.readTime?pi(r.readTime):V.min(),s=Kt.newNoDocument(i,o),a=r.removedTargetIds||[];n=new Zr([],a,s.key,s)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const i=vi(e,r.document),o=r.removedTargetIds||[];n=new Zr([],o,i,null)}else{if(!("filter"in t))return b();{t.filter;const e=t.filter;e.targetId;const{count:r=0,unchangedNames:i}=e,o=new Fr(r,i),s=e.targetId;n=new ei(s,o)}}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return V.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?V.min():t.readTime?pi(t.readTime):V.min()}(e);return this.listener.h_(t,n)}P_(e){const t={};t.database=Ii(this.serializer),t.addTarget=function(e,t){let n;const r=t.target;if(n=wn(r)?{documents:ki(e,r)}:{query:xi(e,r)._t},n.targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=di(e,t.resumeToken);const r=ci(e,t.expectedCount);null!==r&&(n.expectedCount=r)}else if(t.snapshotVersion.compareTo(V.min())>0){n.readTime=hi(e,t.snapshotVersion.toTimestamp());const r=ci(e,t.expectedCount);null!==r&&(n.expectedCount=r)}return n}(this.serializer,e);const n=function(e,t){const n=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return b()}}(t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.i_(t)}I_(e){const t={};t.database=Ii(this.serializer),t.removeTarget=e,this.i_(t)}}class fa extends ha{constructor(e,t,n,r,i,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,r,o),this.serializer
1=i,this.T_=!1}get E_(){return this.T_}start(){this.T_=!1,this.lastStreamToken=void 0,super.start()}__(){this.T_&&this.d_([])}l_(e,t){return this.connection.Oo("Write",e,t)}onMessage(e){if(w(!!e.streamToken),this.lastStreamToken=e.streamToken,this.T_){this.Yo.reset();const t=function(e,t){return e&&e.length>0?(w(void 0!==t),e.map(e=>function(e,t){let n=e.updateTime?pi(e.updateTime):pi(t);return n.isEqual(V.min())&&(n=pi(t)),new vr(n,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),n=pi(e.commitTime);return this.listener.A_(n,t)}return w(!e.writeResults||0===e.writeResults.length),this.T_=!0,this.listener.R_()}V_(){const e={};e.database=Ii(this.serializer),this.i_(e)}d_(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>Ai(this.serializer,e))};this.i_(t)}}class pa extends class{}{constructor(e,t,n,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=r,this.m_=!1}f_(){if(this.m_)throw new S(E.FAILED_PRECONDITION,"The client has already been terminated.")}Co(e,t,n,r){return this.f_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection.Co(e,gi(t,n),r,i,o)).catch(e=>{throw"FirebaseError"===e.name?(e.code===E.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new S(E.UNKNOWN,e.toString())})}xo(e,t,n,r,i){return this.f_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,s])=>this.connection.xo(e,gi(t,n),r,o,s,i)).catch(e=>{throw"FirebaseError"===e.name?(e.code===E.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new S(E.UNKNOWN,e.toString())})}terminate(){this.m_=!0,this.connection.terminate()}}class ma{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.g_=0,this.p_=null,this.y_=!0}w_(){0===this.g_&&(this.S_("Unknown"),this.p_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.p_=null,this.b_("Backend didn't respond within 10 seconds."),this.S_("Offline"),Promise.resolve())))}D_(e){"Online"===this.state?this.S_("Unknown"):(this.g_++,this.g_>=1&&(this.C_(),this.b_("Connection failed 1 times. Most recent error: "+e.toString()),this.S_("Offline")))}set(e){this.C_(),this.g_=0,"Online"===e&&(this.y_=!1),this.S_(e)}S_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}b_(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.y_?(_(t),this.y_=!1):g("OnlineStateTracker",t)}C_(){null!==this.p_&&(this.p_.cancel(),this.p_=null)}}class ga{constructor(e,t,n,r,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.v_=[],this.F_=new Map,this.M_=new Set,this.x_=[],this.O_=i,this.O_.io(e=>{n.enqueueAndForget(async()=>{Sa(this)&&(g("RemoteStore","Restarting streams for network reachability change."),await async function(e){const t=T(e);t.M_.add(4),await ya(t),t.N_.set("Unknown"),t.M_.delete(4),await _a(t)}(this))})}),this.N_=new ma(n,r)}}async function _a(e){if(Sa(e))for(const t of e.x_)await t(!0)}async function ya(e){for(const t of e.x_)await t(!1)}function va(e,t){const n=T(e);n.F_.has(t.targetId)||(n.F_.set(t.targetId,t),Ea(n)?Ta(n):Ga(n).Xo()&&wa(n,t))}function ba(e,t){const n=T(e),r=Ga(n);n.F_.delete(t),r.Xo()&&Ia(n,t),0===n.F_.size&&(r.Xo()?r.n_():Sa(n)&&n.N_.set("Unknown"))}function wa(e,t){if(e.L_.xe(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(V.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}Ga(e).P_(t)}function Ia(e,t){e.L_.xe(t),Ga(e).I_(t)}function Ta(e){e.L_=new ri({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),ot:t=>e.F_.get(t)||null,tt:()=>e.datastore.serializer.databaseId}),Ga(e).start(),e.N_.w_()}function Ea(e){return Sa(e)&&!Ga(e).Zo()&&e.F_.size>0}function Sa(e){return 0===T(e).M_.size}function Aa(e){e.L_=void 0}async function Ca(e){e.N_.set("Online")}async function ka(e){e.F_.forEach((t,n)=>{wa(e,t)})}async function xa(e,t){Aa(e),Ea(e)?(e.N_.D_(t),Ta(e)):e.N_.set("Unknown")}async function Na(e,t,n){if(e.N_.set("Online"),t instanceof ti&&2===t.state&&t.cause)try{await async function(e,t){const n=t.cause;for(const r of t.targetIds)e.F_.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e.F_.delete(r),e.L_.removeTarget(r))}(e,t)}catch(n){g("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),await Da(e,n)}else if(t instanceof Zr?e.L_.Ke(t):t instanceof ei?e.L_.He(t):e.L_.We(t),!n.isEqual(V.min()))try{const t=await Rs(e.localStore);n.compareTo(t)>=0&&await function(e,t){const n=e.L_.rt(t);
1return n.targetChanges.forEach((n,r)=>{if(n.resumeToken.approximateByteSize()>0){const i=e.F_.get(r);i&&e.F_.set(r,i.withResumeToken(n.resumeToken,t))}}),n.targetMismatches.forEach((t,n)=>{const r=e.F_.get(t);if(!r)return;e.F_.set(t,r.withResumeToken(pt.EMPTY_BYTE_STRING,r.snapshotVersion)),Ia(e,t);const i=new Fi(r.target,t,n,r.sequenceNumber);wa(e,i)}),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){g("RemoteStore","Failed to raise snapshot:",t),await Da(e,t)}}async function Da(e,t,n){if(!pe(t))throw t;e.M_.add(1),await ya(e),e.N_.set("Offline"),n||(n=()=>Rs(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{g("RemoteStore","Retrying IndexedDB access"),await n(),e.M_.delete(1),await _a(e)})}function Oa(e,t){return t().catch(n=>Da(e,n,t))}async function Ra(e){const t=T(e),n=Ha(t);let r=t.v_.length>0?t.v_[t.v_.length-1].batchId:-1;for(;Pa(t);)try{const e=await Ls(t.localStore,r);if(null===e){0===t.v_.length&&n.n_();break}r=e.batchId,La(t,e)}catch(e){await Da(t,e)}ja(t)&&qa(t)}function Pa(e){return Sa(e)&&e.v_.length<10}function La(e,t){e.v_.push(t);const n=Ha(e);n.Xo()&&n.E_&&n.d_(t.mutations)}function ja(e){return Sa(e)&&!Ha(e).Zo()&&e.v_.length>0}function qa(e){Ha(e).start()}async function Ma(e){Ha(e).V_()}async function Fa(e){const t=Ha(e);for(const n of e.v_)t.d_(n.mutations)}async function Ua(e,t,n){const r=e.v_.shift(),i=jr.from(r,t,n);await Oa(e,()=>e.remoteSyncer.applySuccessfulWrite(i)),await Ra(e)}async function za(e,t){t&&Ha(e).E_&&await async function(e,t){if(function(e){return Vr(e)&&e!==E.ABORTED}(t.code)){const n=e.v_.shift();Ha(e).t_(),await Oa(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await Ra(e)}}(e,t),ja(e)&&qa(e)}async function Va(e,t){const n=T(e);n.asyncQueue.verifyOperationInProgress(),g("RemoteStore","RemoteStore received new credentials");const r=Sa(n);n.M_.add(3),await ya(n),r&&n.N_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.M_.delete(3),await _a(n)}async function Ba(e,t){const n=T(e);t?(n.M_.delete(2),await _a(n)):t||(n.M_.add(2),await ya(n),n.N_.set("Unknown"))}function Ga(e){return e.B_||(e.B_=function(e,t,n){const r=T(e);return r.f_(),new da(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{Po:Ca.bind(null,e),To:ka.bind(null,e),Ao:xa.bind(null,e),h_:Na.bind(null,e)}),e.x_.push(async t=>{t?(e.B_.t_(),Ea(e)?Ta(e):e.N_.set("Unknown")):(await e.B_.stop(),Aa(e))})),e.B_}function Ha(e){return e.k_||(e.k_=function(e,t,n){const r=T(e);return r.f_(),new fa(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{Po:()=>Promise.resolve(),To:Ma.bind(null,e),Ao:za.bind(null,e),R_:Fa.bind(null,e),A_:Ua.bind(null,e)}),e.x_.push(async t=>{t?(e.k_.t_(),await Ra(e)):(await e.k_.stop(),e.v_.length>0&&(g("RemoteStore",`Stopping write stream with ${e.v_.length} pending writes`),e.v_=[]))})),e.k_}class Ka{constructor(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new A,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,r,i){const o=Date.now()+n,s=new Ka(e,t,o,r,i);return s.start(n),s}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new S(E.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function $a(e,t){if(_("AsyncQueue",`${t}: ${e}`),pe(e))return new S(E.UNAVAILABLE,`${t}: ${e}`);throw e}class Wa{constructor(e){this.comparator=e?(t,n)=>e(t,n)||$.comparator(t.key,n.key):(e,t)=>$.comparator(e.key,t.key),this.keyedMap=$n(),this.sortedSet=new ot(this.comparator)}static emptySet(e){return new Wa(e.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,n)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof Wa))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"}copy(e,t){const n=new Wa;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}class Qa{constructor(){this.q_=new ot($.comparator)}track(e){const t=e.doc.key,n=this.q_.get(t);n?0!==e.type&&3===n.type?this.q_=this.q_.insert(t,e):3===e.type&&1!==n.type?this.q_=this.q_.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.q_=this.q_.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.q_=this.q_.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.q_=this.q_.remove(t):1===e.type&&2===n.type?this.q_=this.q_.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.q_=this.q_.insert(t,{type:2,doc:e.doc}):b():this.q_=this.q_.insert(t,e)}Q_(){const e=[];return this.q_.inorderTraversal((t,n)=>{e.push(n)}),e}}class Ya{constructor(e,t,n,r,i,o,s,a,u){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=s,this.excludesMetadataChanges=a,this.hasCachedResults=u}static fromInitialDocuments(e,t,n,r,i){const o=[];
1return t.forEach(e=>{o.push({type:0,doc:e})}),new Ya(e,t,Wa.emptySet(t),o,n,r,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&jn(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e].type!==n[e].type||!t[e].doc.isEqual(n[e].doc))return!1;return!0}}class Ja{constructor(){this.K_=void 0,this.U_=[]}W_(){return this.U_.some(e=>e.G_())}}class Xa{constructor(){this.queries=new Bn(e=>qn(e),jn),this.onlineState="Unknown",this.z_=new Set}}async function Za(e,t){const n=T(e);let r=3;const i=t.query;let o=n.queries.get(i);o?!o.W_()&&t.G_()&&(r=2):(o=new Ja,r=t.G_()?0:1);try{switch(r){case 0:o.K_=await n.onListen(i,!0);break;case 1:o.K_=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(e){const n=$a(e,`Initialization of query '${Mn(t.query)}' failed`);return void t.onError(n)}n.queries.set(i,o),o.U_.push(t),t.j_(n.onlineState),o.K_&&t.H_(o.K_)&&ru(n)}async function eu(e,t){const n=T(e),r=t.query;let i=3;const o=n.queries.get(r);if(o){const e=o.U_.indexOf(t);e>
1=0&&(o.U_.splice(e,1),0===o.U_.length?i=t.G_()?0:1:!o.W_()&&t.G_()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function tu(e,t){const n=T(e);let r=!1;for(const e of t){const t=e.query,i=n.queries.get(t);if(i){for(const t of i.U_)t.H_(e)&&(r=!0);i.K_=e}}r&&ru(n)}function nu(e,t,n){const r=T(e),i=r.queries.get(t);if(i)for(const e of i.U_)e.onError(n);r.queries.delete(t)}function ru(e){e.z_.forEach(e=>{e.next()})}var iu,ou;(ou=iu||(iu={})).J_="default",ou.Cache="cache";class su{constructor(e,t,n){this.query=e,this.Y_=t,this.Z_=!1,this.X_=null,this.onlineState="Unknown",this.options=n||{}}H_(e){if(!this.options.includeMetadataChanges){const t=[];for(const n of e.docChanges)3!==n.type&&t.push(n);e=new Ya(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Z_?this.ea(e)&&(this.Y_.next(e),t=!0):this.ta(e,this.onlineState)&&(this.na(e),t=!0),this.X_=e,t}onError(e){this.Y_.error(e)}j_(e){this.onlineState=e;let t=!1;return this.X_&&!this.Z_&&this.ta(this.X_,e)&&(this.na(this.X_),t=!0),t}ta(e,t){if(!e.fromCache)return!0;if(!this.G_())return!0;const n="Offline"!==t;return(!this.options.ra||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}ea(e){if(e.docChanges.length>0)return!0;const t=this.X_&&this.X_.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}na(e){e=Ya.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Z_=!0,this.Y_.next(e)}G_(){return this.options.source!==iu.Cache}}class au{constructor(e,t){this.ia=e,this.byteLength=t}sa(){return"metadata"in this.ia}}class uu{constructor(e){this.serializer=e}Ps(e){return vi(this.serializer,e)}Is(e){return e.metadata.exists?Si(this.serializer,e.document,!1):Kt.newNoDocument(this.Ps(e.metadata.name),this.Ts(e.metadata.readTime))}Ts(e){return pi(e)}}class lu{constructor(e,t,n){this.oa=e,this.localStore=t,this.serializer=n,this.queries=[],this.documents=[],this.collectionGroups=new Set,this.progress=cu(e)}_a(e){this.progress.bytesLoaded+=e.byteLength;let t=this.progress.documentsLoaded;if(e.ia.namedQuery)this.queries.push(e.ia.namedQuery);else if(e.ia.documentMetadata){this.documents.push({metadata:e.ia.documentMetadata}),e.ia.documentMetadata.exists||++t;const n=G.fromString(e.ia.documentMetadata.name);this.collectionGroups.add(n.get(n.length-2))}else e.ia.document&&(this.documents[this.documents.length-1].document=e.ia.document,++t);return t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,Object.assign({},this.progress)):null}aa(e){const t=new Map,n=new uu(this.serializer);for(const r of e)if(r.metadata.queries){const e=n.Ps(r.metadata.name);for(const n of r.metadata.queries){const r=(t.get(n)||er()).add(e);t.set(n,r)}}return t}async complete(){const e=await async function(e,t,n,r){const i=T(e);let o=er(),s=Hn();for(const e of n){const n=t.Ps(e.metadata.name);e.document&&(o=o.add(n));const r=t.Is(e);r.setReadTime(t.Ts(e.metadata.readTime)),s=s.insert(n,r)}const a=i.os.newChangeBuffer({trackRemovals:!0}),u=await js(i,function(e){return Dn(Cn(G.fromString("__bundle__/docs/"+e)))}(r));return i.persistence.runTransaction("Apply bundle documents","readwrite",e=>Ps(e,a,s).next(t=>(a.apply(e),t)).next(t=>i.Qr.removeMatchingKeysForTargetId(e,u.targetId).next(()=>i.Qr.addMatchingKeys(e,o,u.targetId)).next(()=>i.localDocuments.getLocalViewOfDocuments(e,t.cs,t.ls)).next(()=>t.cs)))}(this.localStore,new uu(this.serializer),this.documents,this.oa.id),t=this.aa(this.documents);for(const e of this.queries)await Vs(this.localStore,e,t.get(e.name));return this.progress.taskState="Success",{progress:this.progress,ua:this.collectionGroups,ca:e}}}function cu(e){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}class hu{constructor(e){this.key=e}}class du{constructor(e){this.key=e}}class fu{constructor(e,t){this.query=e,this.la=t,this.ha=null,this.hasCachedResults=!1,this.current=!1,this.Pa=er(),this.mutatedKeys=er(),this.Ia=zn(e),this.Ta=new Wa(this.Ia)}get Ea(){return this.la}da(e,t){const n=t?t.Aa:new Qa,r=t?t.Ta:this.Ta;let i=t?t.mutatedKeys:this.mutatedKeys,o=r,s=!1;const a="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,u="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((e,t)=>
1{const l=r.get(e),c=Fn(this.query,t)?t:null,h=!!l&&this.mutatedKeys.has(l.key),d=!!c&&(c.hasLocalMutations||this.mutatedKeys.has(c.key)&&c.hasCommittedMutations);let f=!1;l&&c?l.data.isEqual(c.data)?h!==d&&(n.track({type:3,doc:c}),f=!0):this.Ra(l,c)||(n.track({type:2,doc:c}),f=!0,(a&&this.Ia(c,a)>0||u&&this.Ia(c,u)<0)&&(s=!0)):!l&&c?(n.track({type:0,doc:c}),f=!0):l&&!c&&(n.track({type:1,doc:l}),f=!0,(a||u)&&(s=!0)),f&&(c?(o=o.add(c),i=d?i.add(e):i.delete(e)):(o=o.delete(e),i=i.delete(e)))}),null!==this.query.limit)for(;o.size>this.query.limit;){const e="F"===this.query.limitType?o.last():o.first();o=o.delete(e.key),i=i.delete(e.key),n.track({type:1,doc:e})}return{Ta:o,Aa:n,Xi:s,mutatedKeys:i}}Ra(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n,r){const i=this.Ta;this.Ta=e.Ta,this.mutatedKeys=e.mutatedKeys;const o=e.Aa.Q_();o.sort((e,t)=>function(e,t){const n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return b()}};return n(e)-n(t)}(e.type,t.type)||this.Ia(e.doc,t.doc)),this.Va(n),r=null!=r&&r;const s=t&&!r?this.ma():[],a=0===this.Pa.size&&this.current&&!r?1:0,u=a!==this.ha;return this.ha=a,0!==o.length||u?{snapshot:new Ya(this.query,e.Ta,i,o,e.mutatedKeys,0===a,u,!1,!!n&&n.resumeToken.approximateByteSize()>0),fa:s}:{fa:s}}j_(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({Ta:this.Ta,Aa:new Qa,mutatedKeys:this.mutatedKeys,Xi:!1},!1)):{fa:[]}}ga(e){return!this.la.has(e)&&!!this.Ta.has(e)&&!this.Ta.get(e).hasLocalMutations}Va(e){e&&(e.addedDocuments.forEach(e=>this.la=this.la.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.la=this.la.delete(e)),this.current=e.current)}ma(){if(!this.current)return[];const e=this.Pa;this.Pa=er(),this.Ta.forEach(e=>{this.ga(e.key)&&(this.Pa=this.Pa.add(e.key))});const t=[];return e.forEach(e=>{this.Pa.has(e)||t.push(new du(e))}),this.Pa.forEach(n=>{e.has(n)||t.push(new hu(n))}),t}pa(e){this.la=e.hs,this.Pa=er();const t=this.da(e.documents);return this.applyChanges(t,!0)}ya(){return Ya.fromInitialDocuments(this.query,this.Ta,this.mutatedKeys,0===this.ha,this.hasCachedResults)}}class pu{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class mu{constructor(e){this.key=e,this.wa=!1}}class gu{constructor(e,t,n,r,i,o){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.Sa={},this.ba=new Bn(e=>qn(e),jn),this.Da=new Map,this.Ca=new Set,this.va=new ot($.comparator),this.Fa=new Map,this.Ma=new cs,this.xa={},this.Oa=new Map,this.Na=Fo.Ln(),this.onlineState="Unknown",this.La=void 0}get isPrimaryClient(){return!0===this.La}}async function _u(e,t,n=!0){const r=Ku(e);let i;const o=r.ba.get(t);return o?(r.sharedClientState.addLocalQueryTarget(o.targetId),i=o.view.ya()):i=await vu(r,t,n,!0),i}async function yu(e,t){const n=Ku(e);await vu(n,t,!0,!1)}async function vu(e,t,n,r){const i=await js(e.localStore,Dn(t)),o=i.targetId,s=n?e.sharedClientState.addLocalQueryTarget(o):"not-current";let a;return r&&(a=await bu(e,t,o,"current"===s,i.resumeToken)),e.isPrimaryClient&&n&&va(e.remoteStore,i),a}async function bu(e,t,n,r,i){e.Ba=(t,n,r)=>async function(e,t,n,r){let i=t.view.da(n);i.Xi&&(i=await Ms(e.localStore,t.query,!1).then(({documents:e})=>t.view.da(e,i)));const o=r&&r.targetChanges.get(t.targetId),s=r&&null!=r.targetMismatches.get(t.targetId),a=t.view.applyChanges(i,e.isPrimaryClient,o,s);return Ou(e,t.targetId,a.fa),a.snapshot}(e,t,n,r);const o=await Ms(e.localStore,t,!0),s=new fu(t,o.hs),a=s.da(o.documents),u=Xr.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState,i),l=s.applyChanges(a,e.isPrimaryClient,u);Ou(e,n,l.fa);const c=new pu(t,n,s);return e.ba.set(t,c),e.Da.has(n)?e.Da.get(n).push(t):e.Da.set(n,[t]),l.snapshot}async function wu(e,t,n){const r=T(e),i=r.ba.get(t),o=r.Da.get(i.targetId);if(o.length>1)return r.Da.set(i.targetId,o.filter(e=>!jn(e,t))),void r.ba.delete(t);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedCl
1ientState.isActiveQueryTarget(i.targetId)||await qs(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&ba(r.remoteStore,i.targetId),Nu(r,i.targetId)}).catch(ae)):(Nu(r,i.targetId),await qs(r.localStore,i.targetId,!0))}async function Iu(e,t){const n=T(e),r=n.ba.get(t),i=n.Da.get(r.targetId);n.isPrimaryClient&&1===i.length&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),ba(n.remoteStore,r.targetId))}async function Tu(e,t){const n=T(e);try{const e=await function(e,t){const n=T(e),r=t.snapshotVersion;let i=n.ns;return n.persistence.runTransaction("Apply remote event","readwrite-primary",e=>{const o=n.os.newChangeBuffer({trackRemovals:!0});i=n.ns;const s=[];t.targetChanges.forEach((o,a)=>{const u=i.get(a);if(!u)return;s.push(n.Qr.removeMatchingKeys(e,o.removedDocuments,a).next(()=>n.Qr.addMatchingKeys(e,o.addedDocuments,a)));let l=u.withSequenceNumber(e.currentSequenceNumber);null!==t.targetMismatches.get(a)?l=l.withResumeToken(pt.EMPTY_BYTE_STRING,V.min()).withLastLimboFreeSnapshotVersion(V.min()):o.resumeToken.approximateByteSize()>0&&(l=l.withResumeToken(o.resumeToken,r)),i=i.insert(a,l),function(e,t,n){return 0===e.resumeToken.approximateByteSize()||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(u,l,o)&&s.push(n.Qr.updateTargetData(e,l))});let a=Hn(),u=er();if(t.documentUpdates.forEach(r=>{t.resolvedLimboDocuments.has(r)&&s.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))}),s.push(Ps(e,o,t.documentUpdates).next(e=>{a=e.cs,u=e.ls})),!r.isEqual(V.min())){const t=n.Qr.getLastRemoteSnapshotVersion(e).next(t=>n.Qr.setTargetsMetadata(e,e.currentSequenceNumber,r));s.push(t)}return ue.waitFor(s).next(()=>o.apply(e)).next(()=>n.localDocuments.getLocalViewOfDocuments(e,a,u)).next(()=>a)}).then(e=>(n.ns=i,e))}(n.localStore,t);
1t.targetChanges.forEach((e,t)=>{const r=n.Fa.get(t);r&&(w(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1),e.addedDocuments.size>0?r.wa=!0:e.modifiedDocuments.size>0?w(r.wa):e.removedDocuments.size>0&&(w(r.wa),r.wa=!1))}),await Lu(n,e,t)}catch(e){await ae(e)}}function Eu(e,t,n){const r=T(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){const e=[];r.ba.forEach((n,r)=>{const i=r.view.j_(t);i.snapshot&&e.push(i.snapshot)}),function(e,t){const n=T(e);n.onlineState=t;let r=!1;n.queries.forEach((e,n)=>{for(const e of n.U_)e.j_(t)&&(r=!0)}),r&&ru(n)}(r.eventManager,t),e.length&&r.Sa.h_(e),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function Su(e,t,n){const r=T(e);r.sharedClientState.updateQueryState(t,"rejected",n);const i=r.Fa.get(t),o=i&&i.key;if(o){let e=new ot($.comparator);e=e.insert(o,Kt.newNoDocument(o,V.min()));const n=er().add(o),i=new Jr(V.min(),new Map,new ot(M),e,n);await Tu(r,i),r.va=r.va.remove(o),r.Fa.delete(t),Pu(r)}else await qs(r.localStore,t,!1).then(()=>Nu(r,t,n)).catch(ae)}async function Au(e,t){const n=T(e),r=t.batch.batchId;try{const e=await function(e,t){const n=T(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const r=t.batch.keys(),i=n.os.newChangeBuffer({trackRemovals:!0});return function(e,t,n,r){const i=n.batch,o=i.keys();let s=ue.resolve();return o.forEach(e=>{s=s.next(()=>r.getEntry(t,e)).next(t=>{const o=n.docVersions.get(e);w(null!==o),t.version.compareTo(o)<0&&(i.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))})}),s.next(()=>e.mutationQueue.removeMutationBatch(t,i))}(n,e,t,i).next(()=>i.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=er();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,r))})}(n.localStore,t);xu(n,r,null),ku(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await Lu(n,e)}catch(e){await ae(e)}}async function Cu(e,t,n){const r=T(e);try{const e=await function(e,t){const n=T(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let r;
1return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(w(null!==t),r=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,r)).next(()=>n.localDocuments.getDocuments(e,r))})}(r.localStore,t);xu(r,t,n),ku(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await Lu(r,e)}catch(n){await ae(n)}}function ku(e,t){(e.Oa.get(t)||[]).forEach(e=>{e.resolve()}),e.Oa.delete(t)}function xu(e,t,n){const r=T(e);let i=r.xa[r.currentUser.toKey()];if(i){const e=i.get(t);e&&(n?e.reject(n):e.resolve(),i=i.remove(t)),r.xa[r.currentUser.toKey()]=i}}function Nu(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const r of e.Da.get(t))e.ba.delete(r),n&&e.Sa.ka(r,n);e.Da.delete(t),e.isPrimaryClient&&e.Ma.Vr(t).forEach(t=>{e.Ma.containsKey(t)||Du(e,t)})}function Du(e,t){e.Ca.delete(t.path.canonicalString());const n=e.va.get(t);null!==n&&(ba(e.remoteStore,n),e.va=e.va.remove(t),e.Fa.delete(n),Pu(e))}function Ou(e,t,n){for(const r of n)r instanceof hu?(e.Ma.addReference(r.key,t),Ru(e,r)):r instanceof du?(g("SyncEngine","Document no longer in limbo: "+r.key),e.Ma.removeReference(r.key,t),e.Ma.containsKey(r.key)||Du(e,r.key)):b()}function Ru(e,t){const n=t.key,r=n.path.canonicalString();e.va.get(n)||e.Ca.has(r)||(g("SyncEngine","New document in limbo: "+n),e.Ca.add(r),Pu(e))}function Pu(e){for(;e.Ca.size>0&&e.va.size<e.maxConcurrentLimboResolutions;){const t=e.Ca.values().next().value;e.Ca.delete(t);const n=new $(G.fromString(t)),r=e.Na.next();e.Fa.set(r,new mu(n)),e.va=e.va.insert(n,r),va(e.remoteStore,new Fi(Dn(Cn(n.path)),r,"TargetPurposeLimboResolution",we.oe))}}async function Lu(e,t,n){const r=T(e),i=[],o=[],s=[];r.ba.isEmpty()||(r.ba.forEach((e,a)=>{s.push(r.Ba(a,t,n).then(e=>{if((e||n)&&r.isPrimaryClient){const t=e&&!e.fromCache;r.sharedClientState.updateQueryState(a.targetId,t?"current":"not-current")}if(e){i.push(e);const t=Cs.Ki(a.targetId,e);o.push(t)}}))}),await Promise.all(s),r.Sa.h_(i),await async function(e,t){const n=T(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>ue.forEach(t,t=>ue.forEach(t.qi,r=>n.persistence.referenceDelegate.addReference(e,t.targetId,r)).next(()=>ue.forEach(t.Qi,r=>n.persistence.referenceDelegate.removeReference(e,t.targetId,r)))))}catch(e){if(!pe(e))throw e;g("LocalStore","Failed to update sequence numbers: "+e)}for(const e of t){const t=e.targetId;if(!e.fromCache){const e=n.ns.get(t),r=e.snapshotVersion,i=e.withLastLimboFreeSnapshotVersion(r);n.ns=n.ns.insert(t,i)}}}(r.localStore,o))}async function ju(e,t){const n=T(e);if(!n.currentUser.isEqual(t)){g("SyncEngine","User change. New user:",t.toKey());const e=await Os(n.localStore,t);n.currentUser=t,function(e){e.Oa.forEach(e=>{e.forEach(e=>{e.reject(new S(E.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),e.Oa.clear()}(n),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await Lu(n,e.us)}}function qu(e,t){const n=T(e),r=n.Fa.get(t);if(r&&r.wa)return er().add(r.key);{let e=er();const r=n.Da.get(t);if(!r)return e;for(const t of r){const r=n.ba.get(t);e=e.unionWith(r.view.Ea)}return e}}async function Mu(e,t){const n=T(e),r=await Ms(n.localStore,t.query,!0),i=t.view.pa(r);return n.isPrimaryClient&&Ou(n,t.targetId,i.fa),i}async function Fu(e,t){const n=T(e);return Us(n.localStore,t).then(e=>Lu(n,e))}async function Uu(e,t,n,r){const i=T(e),o=await function(e,t){const n=T(e),r=T(n.mutationQueue);return n.persistence.runTransaction("Lookup mutation documents","readonly",e=>r.vn(e,t).next(t=>t?n.localDocuments.getDocuments(e,t):ue.resolve(null)))}(i.localStore,t);null!==o?("pending"===n?await Ra(i.remoteStore):"acknowledged"===n||"rejected"===n?(xu(i,t,r||null),ku(i,t),function(e,t){T(T(e).mutationQueue).Mn(t)}(i.localStore,t)):b(),await Lu(i,o)):g("SyncEngine","Cannot apply mutation batch with id: "+t)}async function zu(e,t,n){const r=T(e),i=[],o=[];for(const e of t){let t;const n=r.Da.get(e);if(n&&0!==n.length){t=await js(r.localStore,Dn(n[0]));for(const e of n){const t=r.ba.get(e),n=await Mu(r,t);n.snapshot&&o.push(n.snapshot)}}else{const n=await Fs(r.localStore,e);t=await js(r.localStore,n),await bu(r,Vu(n),e,!1,t.resumeToken)}i.push(t)}return r.Sa.h_(o),i}function Vu(e){return An(e.path,e.collectionGroup,e.orderBy,e.filters,e.limit,"F",e.startAt,e.endAt)}function Bu(e){return function(e){return T(T(e).persistence).Bi()}(T(e).localStore)}async function Gu(e,t,n,r){const i=T(e);if(i.La)return void g("SyncEngine","Ignoring unexpected query state notification.");const o=i.Da.get(t);if(o&&o.length>0)switch(n){case"current":case"not-current":{const e=await Us(i.localStore,Un(o[0])),r=Jr.createSynthesizedRemoteEventForCurrentChange(t,"current"===n,pt.EMPTY_BYTE_STRING);await Lu(i,e,r);break}case"rejected":await qs(i.localStore,t,!0),Nu(i,t,r);break;default:b()}}async function Hu(e,t,n){const r=Ku(e);
1if(r.La){for(const e of t){if(r.Da.has(e)&&r.sharedClientState.isActiveQueryTarget(e)){g("SyncEngine","Adding an already active target "+e);continue}const t=await Fs(r.localStore,e),n=await js(r.localStore,t);await bu(r,Vu(t),n.targetId,!1,n.resumeToken),va(r.remoteStore,n)}for(const e of n)r.Da.has(e)&&await qs(r.localStore,e,!1).then(()=>{ba(r.remoteStore,e),Nu(r,e)}).catch(ae)}}function Ku(e){const t=T(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=Tu.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=qu.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=Su.bind(null,t),t.Sa.h_=tu.bind(null,t.eventManager),t.Sa.ka=nu.bind(null,t.eventManager),t}function $u(e){const t=T(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=Au.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=Cu.bind(null,t),t}class Wu{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=la(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,t){return null}createIndexBackfillerScheduler(e,t){return null}createLocalStore(e){return Ds(this.persistence,new xs,e.initialUser,this.serializer)}createPersistence(e){return new gs(ys.Hr,this.serializer)}createSharedClientState(e){return new Xs}async terminate(){var e,t;null===(e=this.gcScheduler)||void 0===e||e.stop(),null===(t=this.indexBackfillerScheduler)||void 0===t||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class Qu extends Wu{constructor(e){super(),this.cacheSizeBytes=e}createGarbageCollectionScheduler(e,t){w(this.persistence.referenceDelegate instanceof vs);const n=this.persistence.referenceDelegate.garbageCollector;return new Ko(n,e.asyncQueue,t)}createPersistence(e){const t=void 0!==this.cacheSizeBytes?Do.withCacheSize(this.cacheSizeBytes):Do.DEFAULT;return new gs(e=>vs.Hr(e,t),this.serializer)}}class Yu extends Wu{constructor(e,t,n){super(),this.Qa=e,this.cacheSizeBytes=t,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.Qa.initialize(this,e),await $u(this.Qa.syncEngine),await Ra(this.Qa.remoteStore),await this.persistence.fi(()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve()))}createLocalStore(e){return Ds(this.persistence,new xs,e.initialUser,this.serializer)}createGarbageCollectionScheduler(e,t){const n=this.persistence.referenceDelegate.garbageCollector;return new Ko(n,e.asyncQueue,t)}createIndexBackfillerScheduler(e,t){const n=new be(t,this.persistence);return new ve(e.asyncQueue,n)}createPersistence(e){const t=As(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?Do.withCacheSize(this.cacheSizeBytes):Do.DEFAULT;return new Ts(this.synchronizeTabs,t,e.clientId,n,e.asyncQueue,aa(),ua(),this.serializer,this.sharedClientState,!!this.forceOwnership)}createSharedClientState(e){return new Xs}}class Ju extends Yu{constructor(e,t){super(e,t,!1),this.Qa=e,this.cacheSizeBytes=t,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);const t=this.Qa.syncEngine;this.sharedClientState instanceof Js&&(this.sharedClientState.syncEngine={Zs:Uu.bind(null,t),Xs:Gu.bind(null,t),eo:Hu.bind(null,t),Bi:Bu.bind(null,t),Ys:Fu.bind(null,t)},await this.sharedClientState.start()),await this.persistence.fi(async e=>{await async function(e,t){const n=T(e);if(Ku(n),$u(n),!0===t&&!0!==n.La){const e=n.sharedClientState.getAllActiveQueryTargets(),t=await zu(n,e.toArray());n.La=!0,await Ba(n.remoteStore,!0);for(const e of t)va(n.remoteStore,e)}else if(!1===t&&!1!==n.La){const e=[];let t=Promise.resolve();n.Da.forEach((r,i)=>{n.sharedClientState.isLocalQueryTarget(i)?e.push(i):t=t.then(()=>(Nu(n,i),qs(n.localStore,i,!0))),ba(n.remoteStore,i)}),await t,await zu(n,e),function(e){const t=T(e);
1t.Fa.forEach((e,n)=>{ba(t.remoteStore,n)}),t.Ma.mr(),t.Fa=new Map,t.va=new ot($.comparator)}(n),n.La=!1,await Ba(n.remoteStore,!1)}}(this.Qa.syncEngine,e),this.gcScheduler&&(e&&!this.gcScheduler.started?this.gcScheduler.start():e||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(e&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():e||this.indexBackfillerScheduler.stop())})}createSharedClientState(e){const t=aa();if(!Js.D(t))throw new S(E.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=As(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new Js(t,e.asyncQueue,n,e.clientId,e.initialUser)}}class Xu{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>Eu(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=ju.bind(null,this.syncEngine),await Ba(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new Xa}createDatastore(e){const t=la(e.databaseInfo.databaseId),n=function(e){return new sa(e)}(e.databaseInfo);return function(e,t,n,r){return new pa(e,t,n,r)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return function(e,t,n,r,i){return new ga(e,t,n,r,i)}(this.localStore,this.datastore,e.asyncQueue,e=>Eu(this.syncEngine,e,0),ea.D()?new ea:new Zs)}createSyncEngine(e,t){return function(e,t,n,r,i,o,s){const a=new gu(e,t,n,r,i,o);return s&&(a.La=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e;await async function(e){const t=T(e);g("RemoteStore","RemoteStore shutting down."),t.M_.add(5),await ya(t),t.O_.shutdown(),t.N_.set("Unknown")}(this.remoteStore),null===(e=this.datastore)||void 0===e||e.terminate()}}function Zu(e,t=10240){let n=0;return{async read(){if(n<e.byteLength){const r={value:e.slice(n,n+t),done:!1};return n+=t,r}return{done:!0}},async cancel(){},releaseLock(){},closed:Promise.resolve()}}class el{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Ka(this.observer.next,e)}error(e){this.observer.error?this.Ka(this.observer.error,e):_("Uncaught Error in snapshot listener:",e.toString())}$a(){this.muted=!0}Ka(e,t){this.muted||setTimeout(()=>{this.muted||e(t)},0)}}class tl{constructor(e,t){this.Ua=e,this.serializer=t,this.metadata=new A,this.buffer=new Uint8Array,this.Wa=new TextDecoder("utf-8"),this.Ga().then(e=>{e&&e.sa()?this.metadata.resolve(e.ia.metadata):this.metadata.reject(new Error("The first element of the bundle is not a metadata, it is\n             "+JSON.stringify(null==e?void 0:e.ia)))},e=>this.metadata.reject(e))}close(){return this.Ua.cancel()}async getMetadata(){return this.metadata.promise}async qa(){return await this.getMetadata(),this.Ga()}async Ga(){const e=await this.za();if(null===e)return null;const t=this.Wa.decode(e),n=Number(t);isNaN(n)&&this.ja(`length string (${t}) is not valid number`);const r=await this.Ha(n);return new au(JSON.parse(r),e.length+n)}Ja(){return this.buffer.findIndex(e=>e==="{".charCodeAt(0))}async za(){for(;this.Ja()<0&&!await this.Ya(););if(0===this.buffer.length)return null;const e=this.Ja();e<0&&this.ja("Reached the end of bundle when a length string is expected.");const t=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),t}async Ha(e){for(;this.buffer.length<e;)await this.Ya()&&this.ja("Reached the end of bundle when more is expected.");const t=this.Wa.decode(this.buffer.slice(0,e));return this.buffer=this.buffer.slice(e),t}ja(e){throw this.Ua.cancel(),new Error("Invalid bundle format: "+e)}async Ya(){const e=await this.Ua.read();if(!e.done){const t=new Uint8Array(this.buffer.length+e.value.length);t.set(this.buffer),t.set(e.value,this.buffer.length),this.buffer=t}return e.done}}class nl{constructor(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastTransactionError=null,this.writtenDocs=new Set}async lookup(e){if(this.ensureCommitNotCalled(),this.mutations.length>
10)throw this.lastTransactionError=new S(E.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;const t=await async function(e,t){const n=T(e),r={documents:t.map(e=>yi(n.serializer,e))},i=await n.xo("BatchGetDocuments",n.serializer.databaseId,G.emptyPath(),r,t.length),o=new Map;i.forEach(e=>{const t=function(e,t){return"found"in t?function(e,t){w(!!t.found),t.found.name,t.found.updateTime;const n=vi(e,t.found.name),r=pi(t.found.updateTime),i=t.found.createTime?pi(t.found.createTime):V.min(),o=new Gt({mapValue:{fields:t.found.fields}});return Kt.newFoundDocument(n,r,i,o)}(e,t):"missing"in t?function(e,t){w(!!t.missing),w(!!t.readTime);const n=vi(e,t.missing),r=pi(t.readTime);return Kt.newNoDocument(n,r)}(e,t):b()}(n.serializer,e);o.set(t.key.toString(),t)});const s=[];return t.forEach(e=>{const t=o.get(e.toString());w(!!t),s.push(t)}),s}(this.datastore,e);return t.forEach(e=>this.recordVersion(e)),t}set(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(e){this.lastTransactionError=e}this.writtenDocs.add(e.toString())}delete(e){this.write(new Rr(e,this.precondition(e))),this.writtenDocs.add(e.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;const e=this.readVersions;this.mutations.forEach(t=>{e.delete(t.key.toString())}),e.forEach((e,t)=>{const n=$.fromPath(t);this.mutations.push(new Pr(n,this.precondition(n)))}),await async function(e,t){const n=T(e),r={writes:t.map(e=>Ai(n.serializer,e))};await n.Co("Commit",n.serializer.databaseId,G.emptyPath(),r)}(this.datastore,this.mutations),this.committed=!0}recordVersion(e){let t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw b();t=V.min()}const n=this.readVersions.get(e.key.toString());if(n){if(!t.isEqual(n))throw new S(E.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)}precondition(e){const t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?t.isEqual(V.min())?br.exists(!1):br.updateTime(t):br.none()}preconditionForUpdate(e){const t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(V.min()))throw new S(E.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return br.updateTime(t)}return br.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}}class rl{constructor(e,t,n,r,i){this.asyncQueue=e,this.datastore=t,this.options=n,this.updateFunction=r,this.deferred=i,this.Za=n.maxAttempts,this.Yo=new ca(this.asyncQueue,"transaction_retry")}Xa(){this.Za-=1,this.eu()}eu(){this.Yo.$o(async()=>{const e=new nl(this.datastore),t=this.tu(e);t&&t.then(t=>{this.asyncQueue.enqueueAndForget(()=>e.commit().then(()=>{this.deferred.resolve(t)}).catch(e=>{this.nu(e)}))}).catch(e=>{this.nu(e)})})}tu(e){try{const t=this.updateFunction(e);return!Ie(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.deferred.reject(e),null}}nu(e){this.Za>0&&this.ru(e)?(this.Za-=1,this.asyncQueue.enqueueAndForget(()=>(this.eu(),Promise.resolve()))):this.deferred.reject(e)}ru(e){if("FirebaseError"===e.name){const t=e.code;return"aborted"===t||"failed-precondition"===t||"already-exists"===t||!Vr(t)}return!1}}class il{constructor(e,t,n,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=h.UNAUTHENTICATED,this.clientId=q.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,async e=>{g("FirestoreClient","Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(g("FirestoreClient","Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new S(E.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new A;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=$a(t,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function ol(e,t){e.asyncQueue.verifyOperationInProgress(),g("FirestoreClient","Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener(async e=>{r.isEqual(e)||(await Os(t.localStore,e),r=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function sl(e,t){e.asyncQueue.verifyOperationInProgress();const n=await ul(e);g("FirestoreClient","Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(e=>Va(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>Va(t.remoteStore,n)),e._onlineComponents=t}function al(e){return"FirebaseError"===e.name?e.code===E.FAILED_PRECONDITION||e.code===E.UNIMPLEMENT
1ED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}async function ul(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){g("FirestoreClient","Using user provided OfflineComponentProvider");try{await ol(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!al(n))throw n;y("Error using user provided cache. Falling back to memory cache: "+n),await ol(e,new Wu)}}else g("FirestoreClient","Using default OfflineComponentProvider"),await ol(e,new Wu);return e._offlineComponents}async function ll(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(g("FirestoreClient","Using user provided OnlineComponentProvider"),await sl(e,e._uninitializedComponentsProvider._online)):(g("FirestoreClient","Using default OnlineComponentProvider"),await sl(e,new Xu))),e._onlineComponents}function cl(e){return ul(e).then(e=>e.persistence)}function hl(e){return ul(e).then(e=>e.localStore)}function dl(e){return ll(e).then(e=>e.remoteStore)}function fl(e){return ll(e).then(e=>e.syncEngine)}function pl(e){return ll(e).then(e=>e.datastore)}async function ml(e){const t=await ll(e),n=t.eventManager;return n.onListen=_u.bind(null,t.syncEngine),n.onUnlisten=wu.bind(null,t.syncEngine),n.onFirstRemoteStoreListen=yu.bind(null,t.syncEngine),n.onLastRemoteStoreUnlisten=Iu.bind(null,t.syncEngine),n}function gl(e,t,n={}){const r=new A;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,n,r,i){const o=new el({next:o=>{t.enqueueAndForget(()=>eu(e,s));const a=o.docs.has(n);!a&&o.fromCache?i.reject(new S(E.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&o.fromCache&&r&&"server"===r.source?i.reject(new S(E.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(o)},error:e=>i.reject(e)}),s=new su(Cn(n.path),o,{includeMetadataChanges:!0,ra:!0});return Za(e,s)}(await ml(e),e.asyncQueue,t,n,r)),r.promise}function _l(e,t,n={}){const r=new A;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,n,r,i){const o=new el({next:n=>{t.enqueueAndForget(()=>eu(e,s)),n.fromCache&&"server"===r.source?i.reject(new S(E.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(n)},error:e=>i.reject(e)}),s=new su(n,o,{includeMetadataChanges:!0,ra:!0});return Za(e,s)}(await ml(e),e.asyncQueue,t,n,r)),r.promise}function yl(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}const vl=new Map;function bl(e,t,n){if(!n)throw new S(E.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function wl(e,t,n,r){if(!0===t&&!0===r)throw new S(E.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}function Il(e){if(!$.isDocumentKey(e))throw new S(E.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function Tl(e){if($.isDocumentKey(e))throw new S(E.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function El(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return"function"==typeof e?"a function":b()}function Sl(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new S(E.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=El(e);throw new S(E.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}function Al(e,t){if(t<=0)throw new S(E.INVALID_ARGUMENT,`Function ${e}() requires a positive number, but it was: ${t}.`)}class Cl{constructor(e){var t,n;if(void 0===e.host){if(void 0!==e.ssl)throw new S(E.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new S(E.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}wl("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=yl(null!==(n=e.experimentalLongPollingOptions)&&void 0!==n?n:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new S(E.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new S(E.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new S(E.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(e,t){return e.timeoutSeconds===t.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class kl{constructor(e,t,n,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Cl({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new S(E.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new S(E.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Cl(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new k;switch(e.type){case"firstParty":return new O(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new S(E.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
1d credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=vl.get(e);t&&(g("ComponentProvider","Removing Datastore"),vl.delete(e),t.terminate())}(this),Promise.resolve()}}function xl(e,t,n,r={}){var i;const o=(e=Sl(e,kl))._getSettings(),s=`${t}:${n}`;if("firestore.googleapis.com"!==o.host&&o.host!==s&&y("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},o),{host:s,ssl:!1})),r.mockUserToken){let t,n;if("string"==typeof r.mockUserToken)t=r.mockUserToken,n=h.MOCK_USER;else{t=Object(a.g)(r.mockUserToken,null===(i=e._app)||void 0===i?void 0:i.options.projectId);const o=r.mockUserToken.sub||r.mockUserToken.user_id;if(!o)throw new S(E.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new h(o)}e._authCredentials=new x(new C(t,n))}}class Nl{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new Nl(this.firestore,e,this._query)}}class Dl{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Ol(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Dl(this.firestore,e,this._key)}}class Ol extends Nl{constructor(e,t,n){super(e,t,Cn(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Dl(this.firestore,null,new $(e))}withConverter(e){return new Ol(this.firestore,e,this._path)}}function Rl(e,t,...n){if(e=Object(a.p)(e),bl("collection","path",t),e instanceof kl){const r=G.fromString(t,...n);return Tl(r),new Ol(e,null,r)}{if(!(e instanceof Dl||e instanceof Ol))throw new S(E.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(G.fromString(t,...n));return Tl(r),new Ol(e.firestore,null,r)}}function Pl(e,t){if(e=Sl(e,kl),bl("collectionGroup","collection id",t),t.indexOf("/")>=0)throw new S(E.INVALID_ARGUMENT,`Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new Nl(e,null,function(e){return new Sn(G.emptyPath(),e)}(t))}function Ll(e,t,...n){if(e=Object(a.p)(e),1===arguments.length&&(t=q.newId()),bl("doc","path",t),e instanceof kl){const r=G.fromString(t,...n);return Il(r),new Dl(e,null,new $(r))}{if(!(e instanceof Dl||e instanceof Ol))throw new S(E.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(G.fromString(t,...n));return Il(r),new Dl(e.firestore,e instanceof Ol?e.converter:null,new $(r))}}function jl(e,t){return e=Object(a.p)(e),t=Object(a.p)(t),(e instanceof Dl||e instanceof Ol)&&(t instanceof Dl||t instanceof Ol)&&e.firestore===t.firestore&&e.path===t.path&&e.converter===t.converter}function ql(e,t){return e=Object(a.p)(e),t=Object(a.p)(t),e instanceof Nl&&t instanceof Nl&&e.firestore===t.firestore&&jn(e._query,t._query)&&e.converter===t.converter}class Ml{constructor(){this.iu=Promise.resolve(),this.su=[],this.ou=!1,this._u=[],this.au=null,this.uu=!1,this.cu=!1,this.lu=[],this.Yo=new ca(this,"async_queue_retry"),this.hu=()=>{const e=ua();e&&g("AsyncQueue","Visibility state changed to "+e.visibilityState),this.Yo.Wo()};const e=ua();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.hu)}get isShuttingDown(){return this.ou}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Pu(),this.Iu(e)}enterRestrictedMode(e){if(!this.ou){this.ou=!0,this.cu=e||!1;const t=ua();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.hu)}}enqueue(e){if(this.Pu(),this.ou)return new Promise(()=>{});const t=new A;return this.Iu(()=>this.ou&&this.cu?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.su.push(e),this.Tu()))}async Tu(){if(0!==this.su.length){try{await this.su[0](),this.su.shift(),this.Yo.reset()}catch(e){if(!pe(e))throw e;g("AsyncQueue","Operation failed with retryable error: "+e)}this.su.length>0&&this.Yo.$o(()=>this.Tu())}}Iu(e){const t=this.iu.then(()=>(this.uu=!0,e().catch(e=>{throw this.au=e,this.uu=!1,_("INTERNAL UNHANDLED ERROR: ",function(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e)),e}).then(e=>(this.uu=!1,e))));return this.iu=t,t}enqueueAfterDelay(e,t,n){this.Pu(),this.lu.indexOf(e)>-1&&(t=0);const r=Ka.createAndSchedule(this,e,t,n,e=>this.Eu(e));return this._u.push(r),r}Pu(){this.au&&b()}verifyOperationInProgress(){}async du(){let e;do{e=this.iu,await e}while(e!==this.iu)}Au(e){for(const t of this._u)if(t.timerId===e)return!0;return!1}Ru(e){return this.du().then(()=>{this._u.sort((e,t)=>
1e.targetTimeMs-t.targetTimeMs);for(const t of this._u)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.du()})}Vu(e){this.lu.push(e)}Eu(e){const t=this._u.indexOf(e);this._u.splice(t,1)}}function Fl(e){return function(e){if("object"!=typeof e||null===e)return!1;const t=e;for(const e of["next","error","complete"])if(e in t&&"function"==typeof t[e])return!0;return!1}(e)}class Ul{constructor(){this._progressObserver={},this._taskCompletionResolver=new A,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(e,t,n){this._progressObserver={next:e,error:t,complete:n}}catch(e){return this._taskCompletionResolver.promise.catch(e)}then(e,t){return this._taskCompletionResolver.promise.then(e,t)}_completeWith(e){this._updateProgress(e),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(e)}_failWith(e){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(e),this._taskCompletionResolver.reject(e)}_updateProgress(e){this._lastProgress=e,this._progressObserver.next&&this._progressObserver.next(e)}}const zl=-1;class Vl extends kl{constructor(e,t,n,r){super(e,t,n,r),this.type="firestore",this._queue=new Ml,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||Kl(this),this._firestoreClient.terminate()}}function Bl(e,t,n){n||(n="(default)");const r=Object(i._getProvider)(e,"firestore");if(r.isInitialized(n)){const e=r.getImmediate({identifier:n}),i=r.getOptions(n);if(Object(a.i)(i,t))return e;throw new S(E.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(void 0!==t.cacheSizeBytes&&void 0!==t.localCache)throw new S(E.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(void 0!==t.cacheSizeBytes&&-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new S(E.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return r.initialize({options:t,instanceIdentifier:n})}function Gl(e,t){const n="object"==typeof e?e:Object(i.getApp)(),r="string"==typeof e?e:t||"(default)",o=Object(i._getProvider)(n,"firestore").getImmediate({identifier:r});if(!o._initialized){const e=Object(a.n)("firestore");e&&xl(o,...e)}return o}function Hl(e){return e._firestoreClient||Kl(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function Kl(e){var t,n,r;const i=e._freezeSettings(),o=function(e,t,n,r){return new It(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,yl(r.experimentalLongPollingOptions),r.useFetchStreams)}(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,i);e._firestoreClient=new il(e._authCredentials,e._appCheckCredentials,e._queue,o),(null===(n=i.localCache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(r=i.localCache)||void 0===r?void 0:r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}function $l(e,t){rc(e=Sl(e,Vl));const n=Hl(e);if(n._uninitializedComponentsProvider)throw new S(E.FAILED_PRECONDITION,"SDK cache is already specified.");
1y("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");const r=e._freezeSettings(),i=new Xu;return Ql(n,i,new Yu(i,r.cacheSizeBytes,null==t?void 0:t.forceOwnership))}function Wl(e){rc(e=Sl(e,Vl));const t=Hl(e);if(t._uninitializedComponentsProvider)throw new S(E.FAILED_PRECONDITION,"SDK cache is already specified.");y("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");const n=e._freezeSettings(),r=new Xu;return Ql(t,r,new Ju(r,n.cacheSizeBytes))}function Ql(e,t,n){const r=new A;return e.asyncQueue.enqueue(async()=>{try{await ol(e,n),await sl(e,t),r.resolve()}catch(e){const t=e;if(!al(t))throw t;y("Error enabling indexeddb cache. Falling back to memory cache: "+t),r.reject(t)}}).then(()=>r.promise)}function Yl(e){if(e._initialized&&!e._terminated)throw new S(E.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const t=new A;return e._queue.enqueueAndForgetEvenWhileRestricted(async()=>{try{await async function(e){if(!ce.D())return Promise.resolve();const t=e+"main";await ce.delete(t)}(As(e._databaseId,e._persistenceKey)),t.resolve()}catch(e){t.reject(e)}}),t.promise}function Jl(e){return function(e){const t=new A;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t){const n=T(e);Sa(n.remoteStore)||g("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const e=await function(e){const t=T(e);return t.persistence.runTransaction("Get highest unacknowledged batch id","readonly",e=>t.mutationQueue.getHighestUnacknowledgedBatchId(e))}(n.localStore);if(-1===e)return void t.resolve();const r=n.Oa.get(e)||[];r.push(t),n.Oa.set(e,r)}catch(e){const n=$a(e,"Initialization of waitForPendingWrites() operation failed");t.reject(n)}}(await fl(e),t)),t.promise}(Hl(e=Sl(e,Vl)))}function Xl(e){return function(e){return e.asyncQueue.enqueue(async()=>{const t=await cl(e),n=await dl(e);return t.setNetworkEnabled(!0),function(e){const t=T(e);return t.M_.delete(0),_a(t)}(n)})}(Hl(e=Sl(e,Vl)))}function Zl(e){return function(e){return e.asyncQueue.enqueue(async()=>{const t=await cl(e),n=await dl(e);return t.setNetworkEnabled(!1),async function(e){const t=T(e);t.M_.add(0),await ya(t),t.N_.set("Offline")}(n)})}(Hl(e=Sl(e,Vl)))}function ec(e){return Object(i._removeServiceInstance)(e.app,"firestore",e._databaseId.database),e._delete()}function tc(e,t){const n=Hl(e=Sl(e,Vl)),r=new Ul;return function(e,t,n,r){const i=function(e,t){let n;return n="string"==typeof e?Hr().encode(e):e,function(e,t){return new tl(e,t)}(function(e,t){if(e instanceof Uint8Array)return Zu(e,t);if(e instanceof ArrayBuffer)return Zu(new Uint8Array(e),t);if(e instanceof ReadableStream)return e.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}(n),t)}(n,la(t));e.asyncQueue.enqueueAndForget(async()=>{!function(e,t,n){const r=T(e);(async function(e,t,n){try{const r=await t.getMetadata();if(await function(e,t){const n=T(e),r=pi(t.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",e=>n.$r.getBundleMetadata(e,t.id)).then(e=>!!e&&e.createTime.compareTo(r)>=0)}(e.localStore,r))return await t.close(),n._completeWith(function(e){return{taskState:"Success",documentsLoaded:e.totalDocuments,bytesLoaded:e.totalBytes,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}(r)),Promise.resolve(new Set);n._updateProgress(cu(r));const i=new lu(r,e.localStore,t.serializer);let o=await t.qa();for(;o;){const e=await i._a(o);e&&n._updateProgress(e),o=await t.qa()}const s=await i.complete();return await Lu(e,s.ca,void 0),await function(e,t){const n=T(e);return n.persistence.runTransaction("Save bundle","readwrite",e=>n.$r.saveBundleMetadata(e,t))}(e.localStore,r),n._completeWith(s.progress),Promise.resolve(s.ua)}catch(e){return y("SyncEngine","Loading bundle failed with "+e),n._failWith(e),Promise.resolve(new Set)}})(r,t,n).then(e=>
1{r.sharedClientState.notifyBundleLoaded(e)})}(await fl(e),i,r)})}(n,e._databaseId,t,r),r}function nc(e,t){return function(e,t){return e.asyncQueue.enqueue(async()=>function(e,t){const n=T(e);return n.persistence.runTransaction("Get named query","readonly",e=>n.$r.getNamedQuery(e,t))}(await hl(e),t))}(Hl(e=Sl(e,Vl)),t).then(t=>t?new Nl(e,null,t.query):null)}function rc(e){if(e._initialized||e._terminated)throw new S(E.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")}class ic{constructor(e="count",t){this._internalFieldPath=t,this.type="AggregateField",this.aggregateType=e}}class oc{constructor(e,t,n){this._userDataWriter=t,this._data=n,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}}class sc{constructor(e){this._byteString=e}static fromBase64String(e){try{return new sc(pt.fromBase64String(e))}catch(e){throw new S(E.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new sc(pt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}class ac{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new S(E.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new K(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}function uc(){return new ac("__name__")}class lc{constructor(e){this._methodName=e}}class cc{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new S(E.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new S(E.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return M(this._lat,e._lat)||M(this._long,e._long)}}const hc=/^__.*__$/;class dc{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new xr(e,this.data,this.fieldMask,t,this.fieldTransforms):new kr(e,this.data,t,this.fieldTransforms)}}class fc{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new xr(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function pc(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw b()}}class mc{constructor(e,t,n,r,i,o){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.mu(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get fu(){return this.settings.fu}gu(e){return new mc(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}pu(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.gu({path:n,yu:!1});return r.wu(e),r}Su(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.gu({path:n,yu:!1});return r.mu(),r}bu(e){return this.gu({path:void 0,yu:!0})}Du(e){return Lc(e,this.settings.methodName,this.settings.Cu||!1,this.path,this.settings.vu)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}mu(){if(this.path)for(let e=0;e<this.path.length;e++)this.wu(this.path.get(e))}wu(e){if(0===e.length)throw this.Du("Document fields must not be empty");if(pc(this.fu)&&hc.test(e))throw this.Du('Document fields cannot begin and end with "__"')}}class gc{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=n||la(e)}Fu(e,t,n,r=!1){return new mc({fu:e,methodName:t,vu:n,path:K.emptyPath(),yu:!1,Cu:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function _c(e){const t=e._freezeSettings(),n=la(e._databaseId);return new gc(e._databaseId,!!t.ignoreUndefinedProperties,n)}function yc(e,t,n,r,i,o={}){const s=e.Fu(o.merge||o.mergeFields?2:0,t,n,i);Dc("Data must be an object, but it was:",s,r);const a=xc(r,s);let u,l;if(o.merge)u=new ht(s.fieldMask),l=s.fieldTransforms;else if(o.mergeFields){const e=[];for(const r of o.mergeFields){const i=Oc(t,r,n);if(!s.contains(i))throw new S(E.INVALID_ARGUMENT,`Field '${i}' is specified in your field mask but missing from your input data.`);jc(e,i)||e.push(i)}u=new ht(e),l=s.fieldTransforms.filter(e=>u.covers(e.field))}else u=null,l=s.fieldTransforms;return new dc(new Gt(a),u,l)}class vc extends lc{_toFieldTransform(e){if(2!==e.fu)throw 1===e.fu?e.Du(this._methodName+"() can only appear at the top level of your update data"):e.Du(this._methodName+"() cannot be used with set() unless you pass {merge:true}");return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof vc}}
1function bc(e,t,n){return new mc({fu:3,vu:t.settings.vu,methodName:e._methodName,yu:n},t.databaseId,t.serializer,t.ignoreUndefinedProperties)}class wc extends lc{_toFieldTransform(e){return new yr(e.path,new cr)}isEqual(e){return e instanceof wc}}class Ic extends lc{constructor(e,t){super(e),this.Mu=t}_toFieldTransform(e){const t=bc(this,e,!0),n=this.Mu.map(e=>kc(e,t)),r=new hr(n);return new yr(e.path,r)}isEqual(e){return e instanceof Ic&&Object(a.i)(this.Mu,e.Mu)}}class Tc extends lc{constructor(e,t){super(e),this.Mu=t}_toFieldTransform(e){const t=bc(this,e,!0),n=this.Mu.map(e=>kc(e,t)),r=new fr(n);return new yr(e.path,r)}isEqual(e){return e instanceof Tc&&Object(a.i)(this.Mu,e.Mu)}}class Ec extends lc{constructor(e,t){super(e),this.xu=t}_toFieldTransform(e){const t=new mr(e.serializer,or(e.serializer,this.xu));return new yr(e.path,t)}isEqual(e){return e instanceof Ec&&this.xu===e.xu}}function Sc(e,t,n,r){const i=e.Fu(1,t,n);Dc("Data must be an object, but it was:",i,r);const o=[],s=Gt.empty();nt(r,(e,r)=>{const u=Pc(t,e,n);r=Object(a.p)(r);const l=i.Su(u);if(r instanceof vc)o.push(u);else{const e=kc(r,l);null!=e&&(o.push(u),s.set(u,e))}});const u=new ht(o);return new fc(s,u,i.fieldTransforms)}function Ac(e,t,n,r,i,o){const s=e.Fu(1,t,n),u=[Oc(t,r,n)],l=[i];if(o.length%2!=0)throw new S(E.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let e=0;e<o.length;e+=2)u.push(Oc(t,o[e])),l.push(o[e+1]);const c=[],h=Gt.empty();for(let e=u.length-1;e>=0;--e)if(!jc(c,u[e])){const t=u[e];let n=l[e];n=Object(a.p)(n);const r=s.Su(t);if(n instanceof vc)c.push(t);else{const e=kc(n,r);null!=e&&(c.push(t),h.set(t,e))}}const d=new ht(c);return new fc(h,d,s.fieldTransforms)}function Cc(e,t,n,r=!1){return kc(n,e.Fu(r?4:3,t))}function kc(e,t){if(Nc(e=Object(a.p)(e)))return Dc("Unsupported field value:",t,e),xc(e,t);if(e instanceof lc)return function(e,t){if(!pc(t.fu))throw t.Du(e._methodName+"() can only be used with update() and set()");if(!t.path)throw t.Du(e._methodName+"() is not currently supported inside arrays");const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.yu&&4!==t.fu)throw t.Du("Nested arrays are not supported");return function(e,t){const n=[];let r=0;for(const i of e){let e=kc(i,t.bu(r));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=Object(a.p)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return or(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=z.fromDate(e);return{timestampValue:hi(t.serializer,n)}}if(e instanceof z){const n=new z(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:hi(t.serializer,n)}}if(e instanceof cc)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof sc)return{bytesValue:di(t.serializer,e._byteString)};if(e instanceof Dl){const n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t.Du(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:mi(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t.Du("Unsupported field value: "+El(e))}(e,t)}function xc(e,t){const n={};return it(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):nt(e,(e,r)=>{const i=kc(r,t.pu(e));null!=i&&(n[e]=i)}),{mapValue:{fields:n}}}function Nc(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof z||e instanceof cc||e instanceof sc||e instanceof Dl||e instanceof lc)}function Dc(e,t,n){if(!Nc(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){const r=El(n);throw"an object"===r?t.Du(e+" a custom object"):t.Du(e+" "+r)}}function Oc(e,t,n){if((t=Object(a.p)(t))instanceof ac)return t._internalPath;if("string"==typeof t)return Pc(e,t);throw Lc("Field path arguments must be of type string or ",e,!1,void 0,n)}const Rc=new RegExp("[~\\*/\\[\\]]");
1function Pc(e,t,n){if(t.search(Rc)>=0)throw Lc(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new ac(...t.split("."))._internalPath}catch(r){throw Lc(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function Lc(e,t,n,r,i){const o=r&&!r.isEmpty(),s=void 0!==i;let a=`Function ${t}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(o||s)&&(u+=" (found",o&&(u+=" in field "+r),s&&(u+=" in document "+i),u+=")"),new S(E.INVALID_ARGUMENT,a+e+u)}function jc(e,t){return e.some(e=>e.isEqual(t))}class qc{constructor(e,t,n,r,i){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new Dl(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new Mc(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(Fc("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class Mc extends qc{data(){return super.data()}}function Fc(e,t){return"string"==typeof t?Pc(e,t):t instanceof ac?t._internalPath:t._delegate._internalPath}function Uc(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new S(E.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class zc{}class Vc extends zc{}function Bc(e,t,...n){let r=[];t instanceof zc&&r.push(t),r=r.concat(n),function(e){const t=e.filter(e=>e instanceof Kc).length,n=e.filter(e=>e instanceof Gc).length;if(t>1||t>0&&n>0)throw new S(E.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const t of r)e=t._apply(e);return e}class Gc extends Vc{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new Gc(e,t,n)}_apply(e){const t=this._parse(e);return lh(e._query,t),new Nl(e.firestore,e.converter,Pn(e._query,t))}_parse(e){const t=_c(e.firestore);return function(e,t,n,r,i,o,s){let a;if(i.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new S(E.INVALID_ARGUMENT,`Invalid Query. You can't perform '${o}' queries on documentId().`);if("in"===o||"not-in"===o){uh(s,o);const t=[];for(const n of s)t.push(ah(r,e,n));a={arrayValue:{values:t}}}else a=ah(r,e,s)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||uh(s,o),a=Cc(n,"where",s,"in"===o||"not-in"===o);return Zt.create(i,o,a)}(e._query,0,t,e.firestore._databaseId,this._field,this._op,this._value)}}function Hc(e,t,n){const r=t,i=Fc("where",e);return Gc._create(i,r,n)}class Kc extends zc{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new Kc(e,t)}_parse(e){const t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:en.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;const r=t.getFlattenedFilters();for(const e of r)lh(n,e),n=Pn(n,e)}(e._query,t),new Nl(e.firestore,e.converter,Pn(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}function $c(...e){return e.forEach(e=>ch("or",e)),Kc._create("or",e)}function Wc(...e){return e.forEach(e=>ch("and",e)),Kc._create("and",e)}class Qc extends Vc{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Qc(e,t)}_apply(e){const t=function(e,t,n){if(null!==e.startAt)throw new S(E.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new S(E.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new Yt(t,n)}(e._query,this._field,this._direction);return new Nl(e.firestore,e.converter,function(e,t){const n=e.explicitOrderBy.concat([t]);return new Sn(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function Yc(e,t="asc"){const n=t,r=Fc("orderBy",e);return Qc._create(r,n)}class Jc extends Vc{constructor(e,t,n){super(),this.type=e,this._limit=t,this._limitType=n}static _create(e,t,n){return new Jc(e,t,n)}_apply(e){return new Nl(e.firestore,e.converter,Ln(e._query,this._limit,this._limitType))}}function Xc(e){return Al("limit",e),Jc._create("limit",e,"F")}function Zc(e){return Al("limitToLast",e),Jc._create("limitToLast",e,"L")}class eh extends Vc{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new eh(e,t,n)}_apply(e){const t=sh(e,this.type,this._docOrFields,this._inclusive);return new Nl(e.firestore,e.converter,function(e,t){return new Sn(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,t,e.endAt)}(e._query,t))}}function th(...e){return eh._create("startAt",e,!0)}function nh(...e){return eh._create("startAfter",e,!1)}class rh extends Vc{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new rh(e,t,n)}_apply(e){const t=sh(e,this.type,this._docOrFields,this._inclusive);return new Nl(e.firestore,e.converter,function(e,t){return new Sn(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,t)}(e._query,t))}}function ih(...e){return rh._create("endBefore",e,!1)}function oh(...e){return rh._create("endAt",e,!0)}function sh(e,t,n,r){if(n[0]=Object(a.p)(n[0]),n[0]instanceof qc)return function(e,t,n,r,i){if(!r)throw new S(E.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${n}().`);const o=[];for(const n of Nn(e))if(n.field.isKeyField())o.push(Ot(t,r.key));else{const e=r.data.field(n.field);if(vt(e))throw new S(E.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+n.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===e){const e=n.field.canonicalString();throw new S(E.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${e}' (used as the orderBy) does not exist.`)}o.push(e)}return new $t(o,i)}(e._query,e.firestore._databaseId,t,n[0]._document,r);{const i=_c(e.firestore);return function(e,t,n,r,i,o){const s=e.explicitOrderBy;if(i.length>s.length)throw new S(E.INVALID_ARGUMENT,`Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const a=[];for(let o=0;o<i.length;o++){const u=i[o];
1if(s[o].field.isKeyField()){if("string"!=typeof u)throw new S(E.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof u}`);if(!xn(e)&&-1!==u.indexOf("/"))throw new S(E.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${r}() must be a plain document ID, but '${u}' contains a slash.`);const n=e.path.child(G.fromString(u));if(!$.isDocumentKey(n))throw new S(E.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);const i=new $(n);a.push(Ot(t,i))}else{const e=Cc(n,r,u);a.push(e)}}return new $t(a,o)}(e._query,e.firestore._databaseId,i,t,n,r)}}function ah(e,t,n){if("string"==typeof(n=Object(a.p)(n))){if(""===n)throw new S(E.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!xn(t)&&-1!==n.indexOf("/"))throw new S(E.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=t.path.child(G.fromString(n));if(!$.isDocumentKey(r))throw new S(E.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return Ot(e,new $(r))}if(n instanceof Dl)return Ot(e,n._key);throw new S(E.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${El(n)}.`)}function uh(e,t){if(!Array.isArray(e)||0===e.length)throw new S(E.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${t.toString()}' filters.`)}function lh(e,t){const n=function(e,t){for(const n of e)for(const e of n.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new S(E.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new S(E.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`)}function ch(e,t){if(!(t instanceof Gc||t instanceof Kc))throw new S(E.INVALID_ARGUMENT,`Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}class hh{convertValue(e,t="none"){switch(At(e)){case 0:return null;case 1:return e.booleanValue;case 2:return _t(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(yt(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw b()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const n={};return nt(e,(e,r)=>{n[e]=this.convertValue(r,t)}),n}convertGeoPoint(e){return new cc(_t(e.latitude),_t(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":const n=bt(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(wt(e));default:return null}}convertTimestamp(e){const t=gt(e);return new z(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=G.fromString(e);w(Mi(n));const r=new Tt(n.get(1),n.get(3)),i=new $(n.popFirst(5));return r.isEqual(t)||_(`Document ${i} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}function dh(e,t,n){let r;return r=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,r}class fh extends hh{constructor(e){super(),this.firestore=e}convertBytes(e){return new sc(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);
1return new Dl(this.firestore,null,t)}}function ph(e){return new ic("sum",Oc("sum",e))}function mh(e){return new ic("avg",Oc("average",e))}function gh(){return new ic("count")}function _h(e,t){var n,r;return e instanceof ic&&t instanceof ic&&e.aggregateType===t.aggregateType&&(null===(n=e._internalFieldPath)||void 0===n?void 0:n.canonicalString())===(null===(r=t._internalFieldPath)||void 0===r?void 0:r.canonicalString())}function yh(e,t){return ql(e.query,t.query)&&Object(a.i)(e.data(),t.data())}class vh{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class bh extends qc{constructor(e,t,n,r,i,o){super(e,t,n,r,o),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new wh(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(Fc("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class wh extends bh{data(e={}){return super.data(e)}}class Ih{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new vh(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new wh(this._firestore,this._userDataWriter,n.key,n,new vh(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new S(E.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{const r=new wh(e._firestore,e._userDataWriter,n.doc.key,n.doc,new vh(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const r=new wh(e._firestore,e._userDataWriter,t.doc.key,t.doc,new vh(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let i=-1,o=-1;return 0!==t.type&&(i=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),o=n.indexOf(t.doc.key)),{type:Th(t.type),doc:r,oldIndex:i,newIndex:o}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function Th(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return b()}}function Eh(e,t){return e instanceof bh&&t instanceof bh?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(null===e._document?null===t._document:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof Ih&&t instanceof Ih&&e._firestore===t._firestore&&ql(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)}function Sh(e){e=Sl(e,Dl);const t=Sl(e.firestore,Vl);return gl(Hl(t),e._key).then(n=>Fh(t,e,n))}class Ah extends hh{constructor(e){super(),this.firestore=e}convertBytes(e){return new sc(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Dl(this.firestore,null,t)}}function Ch(e){e=Sl(e,Dl);const t=Sl(e.firestore,Vl),n=Hl(t),r=new Ah(t);return function(e,t){const n=new A;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,n){try{const r=await function(e,t){const n=T(e);return n.persistence.runTransaction("read document","readonly",e=>n.localDocuments.getDocument(e,t))}(e,t);r.isFoundDocument()?n.resolve(r):r.isNoDocument()?n.resolve(null):n.reject(new S(E.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(e){const r=$a(e,`Failed to get document '${t} from cache`);n.reject(r)}}(await hl(e),t,n)),n.promise}(n,e._key).then(n=>new bh(t,r,e._key,n,new vh(null!==n&&n.hasLocalMutations,!0),e.converter))}function kh(e){e=Sl(e,Dl);const t=Sl(e.firestore,Vl);return gl(Hl(t),e._key,{source:"server"}).then(n=>Fh(t,e,n))}function xh(e){e=Sl(e,Nl);const t=Sl(e.firestore,Vl),n=Hl(t),r=new Ah(t);return Uc(e._query),_l(n,e._query).then(n=>new Ih(t,r,e,n))}function Nh(e){e=Sl(e,Nl);const t=Sl(e.firestore,Vl),n=Hl(t),r=new Ah(t);return function(e,t){const n=new A;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,n){try{const r=await Ms(e,t,!0),i=new fu(t,r.hs),o=i.da(r.documents),s=i.applyChanges(o,!1);n.resolve(s.snapshot)}catch(e){const r=$a(e,`Failed to execute query '${t} against cache`);n.reject(r)}}(await hl(e),t,n)),n.promise}(n,e._query).then(n=>new Ih(t,r,e,n))}function Dh(e){e=Sl(e,Nl);const t=Sl(e.firestore,Vl),n=Hl(t),r=new Ah(t);return _l(n,e._query,{source:"server"}).then(n=>new Ih(t,r,e,n))}function Oh(e,t,n){e=Sl(e,Dl);const r=Sl(e.firestore,Vl),i=dh(e.converter,t,n);return Mh(r,[yc(_c(r),"setDoc",e._key,i,null!==e.converter,n).toMutation(e._key,br.none())])}function Rh(e,t,n,...r){e=Sl(e,Dl);const i=Sl(e.firestore,Vl),o=_c(i);let s;return s="string"==typeof(t=Object(a.p)(t))||t instanceof ac?Ac(o,"updateDoc",e._key,t,n,r):Sc(o,"updateDoc",e._key,t),Mh(i,[s.toMutation(e._key,br.exists(!0))])}function Ph(e){return Mh(Sl(e.firestore,Vl),[new Rr(e._key,br.none())])}function Lh(e,t){const n=Sl(e.firestore,Vl),r=Ll(e),i=dh(e.converter,t);return Mh(n,[yc(_c(e.firestore),"addDoc",r._key,i,null!==e.converter,{}).toMutation(r._key,br.exists(!1))]).then(()=>r)}function jh(e,...t){var n,r,i;e=Object(a.p)(e);let o={includeMetadataChanges:!1,source:"default"},s=0;"object"!=typeof t[s]||Fl(t[s])||(o=t[s],s++);const u={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(Fl(t[s])){const e=t[s];t[s]=null===(n=e.next)||void 0===n?void 0:n.bind(e),t[s+1]=null===(r=e.error)||void 0===r?void 0:r.bind(e),t[s+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}let l,c,h;if(e instanceof Dl)c=Sl(e.firestore,Vl),h=Cn(e._key.path),l={next:n=>{t[s]&&t[s](Fh(c,e,n))},error:t[s+1],complete:t[s+2]};else{const n=Sl(e,Nl);c=Sl(n.firestore,Vl),h=n._query;const r=new Ah(c);l={next:e=>{t[s]&&t[s](new Ih(c,r,n,e))},error:t[s+1],complete:t[s+2]},Uc(e._query)}return function(e,t,n,r){const i=new el(r),o=new su(t,i,n);return e.asyncQueue.enqueueAndForget(async()=>Za(await ml(e),o)),()=>{i.$a(),e.asyncQueue.enqueueAndForget(async()=>eu(await ml(e),o))}}(Hl(c),h,u,l)}function qh(e,t){return function(e,t){const n=new el(t);return e.asyncQueue.enqueueAndForget(async()=>function(e,t){T(e).z_.add(t),t.next()}(await ml(e),n)),()=>{n.$a(),e.asyncQueue.enqueueAndForget(async()=>function(e,t){T(e).z_.delete(t)}(await ml(e),n))}}(Hl(e=Sl(e,Vl)),Fl(t)?t:{next:t})}function Mh(e,t){return function(e,t){const n=new A;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,n){const r=$u(e);try{const e=await function(e,t){const n=T(e),r=z.now(),i=t.reduce((e,t)=>
1e.add(t.key),er());let o,s;return n.persistence.runTransaction("Locally write mutations","readwrite",e=>{let a=Hn(),u=er();return n.os.getEntries(e,i).next(e=>{a=e,a.forEach((e,t)=>{t.isValidDocument()||(u=u.add(e))})}).next(()=>n.localDocuments.getOverlayedDocuments(e,a)).next(i=>{o=i;const s=[];for(const e of t){const t=Ar(e,o.get(e.key).overlayedDocument);null!=t&&s.push(new xr(e.key,t,Ht(t.value.mapValue),br.exists(!0)))}return n.mutationQueue.addMutationBatch(e,r,s,t)}).next(t=>{s=t;const r=t.applyToLocalDocumentSet(o,u);return n.documentOverlayCache.saveOverlays(e,t.batchId,r)})}).then(()=>({batchId:s.batchId,changes:Wn(o)}))}(r.localStore,t);r.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let r=e.xa[e.currentUser.toKey()];r||(r=new ot(M)),r=r.insert(t,n),e.xa[e.currentUser.toKey()]=r}(r,e.batchId,n),await Lu(r,e.changes),await Ra(r.remoteStore)}catch(e){const t=$a(e,"Failed to persist write");n.reject(t)}}(await fl(e),t,n)),n.promise}(Hl(e),t)}function Fh(e,t,n){const r=n.docs.get(t._key),i=new Ah(e);return new bh(e,i,t._key,r,new vh(n.hasPendingWrites,n.fromCache),t.converter)}function Uh(e){return zh(e,{count:gh()})}function zh(e,t){const n=Sl(e.firestore,Vl),r=Hl(n),i=rt(t,(e,t)=>new Mr(t,e.aggregateType,e._internalFieldPath));return function(e,t,n){const r=new A;return e.asyncQueue.enqueueAndForget(async()=>{try{const i=await pl(e);r.resolve(async function(e,t,n){var r;const i=T(e),{request:o,ut:s,parent:a}=Ni(i.serializer,On(t),n);i.connection.Do||delete o.parent;const u=(await i.xo("RunAggregationQuery",i.serializer.databaseId,a,o,1)).filter(e=>!!e.result);w(1===u.length);const l=null===(r=u[0].result)||void 0===r?void 0:r.aggregateFields;return Object.keys(l).reduce((e,t)=>(e[s[t]]=l[t],e),{})}(i,t,n))}catch(e){r.reject(e)}}),r.promise}(r,e._query,i).then(t=>function(e,t,n){const r=new Ah(e);return new oc(t,r,n)}(n,e,t))}class Vh{constructor(e){this.kind="memory",this._onlineComponentProvider=new Xu,(null==e?void 0:e.garbageCollector)?this._offlineComponentProvider=e.garbageCollector._offlineComponentProvider:this._offlineComponentProvider=new Wu}toJSON(){return{kind:this.kind}}}class Bh{constructor(e){let t;this.kind="persistent",(null==e?void 0:e.tabManager)?(e.tabManager._initialize(e),t=e.tabManager):(t=Xh(void 0),t._initialize(e)),this._onlineComponentProvider=t._onlineComponentProvider,this._offlineComponentProvider=t._offlineComponentProvider}toJSON(){return{kind:this.kind}}}class Gh{constructor(){this.kind="memoryEager",this._offlineComponentProvider=new Wu}toJSON(){return{kind:this.kind}}}class Hh{constructor(e){this.kind="memoryLru",this._offlineComponentProvider=new Qu(e)}toJSON(){return{kind:this.kind}}}function Kh(){return new Gh}function $h(e){return new Hh(null==e?void 0:e.cacheSizeBytes)}function Wh(e){return new Vh(e)}function Qh(e){return new Bh(e)}class Yh{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=new Xu,this._offlineComponentProvider=new Yu(this._onlineComponentProvider,null==e?void 0:e.cacheSizeBytes,this.forceOwnership)}}class Jh{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=new Xu,this._offlineComponentProvider=new Ju(this._onlineComponentProvider,null==e?void 0:e.cacheSizeBytes)}}function Xh(e){return new Yh(null==e?void 0:e.forceOwnership)}function Zh(){return new Jh}const ed={maxAttempts:5};class td{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=_c(e)}set(e,t,n){this._verifyNotCommitted();const r=nd(e,this._firestore),i=dh(r.converter,t,n),o=yc(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(o.toMutation(r._key,br.none())),this}update(e,t,n,...r){this._verifyNotCommitted();const i=nd(e,this._firestore);let o;return o="string"==typeof(t=Object(a.p)(t))||t instanceof ac?Ac(this._dataReader,"WriteBatch.update",i._key,t,n,r):Sc(this._dataReader,"WriteBatch.update",i._key,t),this._mutations.push(o.toMutation(i._key,br.exists(!0))),this}delete(e){this._verifyNotCommitted();const t=nd(e,this._firestore);return this._mutations=this._mutations.concat(new Rr(t._key,br.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new S(E.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}
1function nd(e,t){if((e=Object(a.p)(e)).firestore!==t)throw new S(E.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}class rd extends class{constructor(e,t){this._firestore=e,this._transaction=t,this._dataReader=_c(e)}get(e){const t=nd(e,this._firestore),n=new fh(this._firestore);return this._transaction.lookup([t._key]).then(e=>{if(!e||1!==e.length)return b();const r=e[0];if(r.isFoundDocument())return new qc(this._firestore,n,r.key,r,t.converter);if(r.isNoDocument())return new qc(this._firestore,n,t._key,null,t.converter);throw b()})}set(e,t,n){const r=nd(e,this._firestore),i=dh(r.converter,t,n),o=yc(this._dataReader,"Transaction.set",r._key,i,null!==r.converter,n);return this._transaction.set(r._key,o),this}update(e,t,n,...r){const i=nd(e,this._firestore);let o;return o="string"==typeof(t=Object(a.p)(t))||t instanceof ac?Ac(this._dataReader,"Transaction.update",i._key,t,n,r):Sc(this._dataReader,"Transaction.update",i._key,t),this._transaction.update(i._key,o),this}delete(e){const t=nd(e,this._firestore);return this._transaction.delete(t._key),this}}{constructor(e,t){super(e,t),this._firestore=e}get(e){const t=nd(e,this._firestore),n=new Ah(this._firestore);return super.get(e).then(e=>new bh(this._firestore,n,t._key,e._document,new vh(!1,!1),t.converter))}}function id(e,t,n){e=Sl(e,Vl);const r=Object.assign(Object.assign({},ed),n);return function(e){if(e.maxAttempts<1)throw new S(E.INVALID_ARGUMENT,"Max attempts must be at least 1")}(r),function(e,t,n){const r=new A;return e.asyncQueue.enqueueAndForget(async()=>{const i=await pl(e);new rl(e.asyncQueue,i,n,t,r).Xa()}),r.promise}(Hl(e),n=>t(new rd(e,n)),r)}function od(){return new vc("deleteField")}function sd(){return new wc("serverTimestamp")}function ad(...e){return new Ic("arrayUnion",e)}function ud(...e){return new Tc("arrayRemove",e)}function ld(e){return new Ec("increment",e)}function cd(e){return Hl(e=Sl(e,Vl)),new td(e,t=>Mh(e,t))}function hd(e,t){var n;const r=Hl(e=Sl(e,Vl));if(!r._uninitializedComponentsProvider||"memory"===(null===(n=r._uninitializedComponentsProvider)||void 0===n?void 0:n._offlineKind))return y("Cannot enable indexes when persistence is disabled"),Promise.resolve();const i=function(e){const t="string"==typeof e?function(e){try{return JSON.parse(e)}catch(e){throw new S(E.INVALID_ARGUMENT,"Failed to parse JSON: "+(null==e?void 0:e.message))}}(e):e,n=[];if(Array.isArray(t.indexes))for(const e of t.indexes){const t=dd(e,"collectionGroup"),r=[];if(Array.isArray(e.fields))for(const t of e.fields){const e=Pc("setIndexConfiguration",dd(t,"fieldPath"));"CONTAINS"===t.arrayConfig?r.push(new X(e,2)):"ASCENDING"===t.order?r.push(new X(e,0)):"DESCENDING"===t.order&&r.push(new X(e,1))}n.push(new W(W.UNKNOWN_ID,t,r,ee.empty()))}return n}(t);return function(e,t){return e.asyncQueue.enqueue(async()=>async function(e,t){const n=T(e),r=n.indexManager,i=[];return n.persistence.runTransaction("Configure indexes","readwrite",e=>r.getFieldIndexes(e).next(n=>function(e,t,n,r,i){e=[...e],t=[...t],e.sort(n),t.sort(n);const o=e.length,s=t.length;let a=0,u=0;for(;a<s&&u<o;){const o=n(e[u],t[a]);o<0?i(e[u++]):o>0?r(t[a++]):(a++,u++)}for(;a<s;)r(t[a++]);for(;u<o;)i(e[u++])}(n,t,J,t=>{i.push(r.addFieldIndex(e,t))},t=>{i.push(r.deleteFieldIndex(e,t))})).next(()=>ue.waitFor(i)))}(await hl(e),t))}(r,i)}function dd(e,t){if("string"!=typeof e[t])throw new S(E.INVALID_ARGUMENT,"Missing string value for: "+t);return e[t]}class fd{constructor(e){this._client=e,this.type="PersistentCacheIndexManager"}}function pd(e){var t;e=Sl(e,Vl);const n=vd.get(e);if(n)return n;const r=Hl(e);if("persistent"!==(null===(t=r._uninitializedComponentsProvider)||void 0===t?void 0:t._offlineKind))return null;const i=new fd(r);return vd.set(e,i),i}function md(e){yd(e,!0)}function gd(e){yd(e,!1)}function _d(e){e._client.verifyNotTerminated(),function(e){return e.asyncQueue.enqueue(async()=>function(e){const t=T(e),n=t.indexManager;return t.persistence.runTransaction("Delete All Indexes","readwrite",e=>n.deleteAllFieldIndexes(e))}(await hl(e)))}(e._client).then(e=>g("deleting all persistent cache indexes succeeded")).catch(e=>y("deleting all persistent cache indexes failed",e))}function yd(e,t){e._client.verifyNotTerminated(),function(e,t){return e.asyncQueue.enqueue(async()=>function(e,t){T(e).ts.Ui=t}(await hl(e),t))}(e._client,t).then(e=>g(`setting persistent cache index auto creation isEnabled=${t} succeeded`)).catch(e=>y(`setting persistent cache index auto creation isEnabled=${t} failed`,e))}const vd=new WeakMap;function bd(e){var t;const n=null===(t=Hl(Sl(e.firestore,Vl))._onlineComponents)||void 0===t?void 0:t.datastore.serializer;return void 0===n?null:xi(n,Dn(e._query))._t}function wd(e,t){var n;const r=rt(t,(e,t)=>new Mr(t,e.aggregateType,e._internalFieldPath)),i=null===(n=Hl(Sl(e.firestore,Vl))._onlineComponents)||void 0===n?void 0:n.datastore.serializer;return void 0===i?null:Ni(i,On(e._query),r,!0).request}class Id{constructor(){throw new Error("instances of this class should not be created")}static onExistenceFilterMismatch(e){return Td.instance.onExistenceFilterMismatch(e)}}class Td{constructor(){this.Ou=new Map}static get instance(){return Ed||(Ed=new Td,function(e){if(Gr)throw new Error("a TestingHooksSpi instance is already set");Gr=e}(Ed)),Ed}et(e){this.Ou.forEach(t=>t(e))}onExistenceFilterMismatch(e){const t=Symbol(),n=this.Ou;return n.set(t,e),()=>n.delete(t)}}let Ed=null;!function(e,t=!0){!function(e){d=e}(i.SDK_VERSION),Object(i._registerComponent)(new o.a("firestore",(e,{instanceIdentifier:n,options:r})=>{const i=e.getProvider("app").getImmediate(),o=new Vl(new N(e.getProvider("auth-internal")),new P(e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new S(E.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Tt(e.options.projectId,t)}(i,n),i);return r=Object.assign({useFetchStreams:t},r),o._setSettings(r),o},"PUBLIC").setMultipleInstances(!0)),Object(i.registerVersion)(c,"4.6.3",e),Object(i.registerVersion)(c,"4.6.3","esm2017")}()}).call(this,n(22),n(31).Buffer)},24:function(e,t,n){"use strict";n.r(t);var r=n(3);n.d(t,"FirebaseError",function(){return r.FirebaseError}),n.d(t,"SDK_VERSION",function(){return r.SDK_VERSION}),n.d(t,"_DEFAULT_ENTRY_NAME",function(){return r._DEFAULT_ENTRY_NAME}),n.d(t,"_addComponent",function(){return r._addComponent}),n.d(t,"_addOrOverwriteComponent",function(){return r._addOrOverwriteComponent}),n.d(t,"_apps",function(){return r._apps}),n.d(t,"_clearComponents",function(){return r._clearComponents}),n.d(t,"_components",function(){return r._components}),n.d(t,"_getProvider",function(){return r._getProvider}),n.d(t,"_isFirebaseApp",function(){return r._isFirebaseApp}),n.d(t,"_isFirebaseServerApp",function(){return r._isFirebaseServerApp}),n.d(t,"_registerComponent",function(){return r._registerComponent}),n.d(t,"_removeServiceInstance",function(){return r._removeServiceInstance}),n.d(t,"_serverApps",function(){return r._serverApps}),n.d(t,"deleteApp",function(){return r.deleteApp}),n.d(t,"getApp",function(){return r.getApp}),n.d(t,"getApps",function(){return r.getApps}),n.d(t,"initializeApp",function(){return r.initializeApp}),n.d(t,"initializeServerApp",function(){return r.initializeServerApp}),n.d(t,"onLog",function(){return r.onLog}),n.d(t,"registerVersion",function(){return r.registerVersion}),n.d(t,"setLogLevel",function(){return r.setLogLevel}),Object(r.registerVersion)("firebase","10.12.1","app")},26:function(e,t,n){var r,i;function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){l=!0,i=e}
1finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r=[n(16),n(24),n(17),n(18),n(21),n(12),n(32),n(20),n(19),n(15)],void 0===(i=function(e,t,n,r,i,s,u,l,c,h){function d(){var e;window.__firebaseAuthDebug&&(e=console).log.apply(e,arguments)}function f(){return!!s.dev}return void 0===window.__firebaseAuthDebug&&(window.__firebaseAuthDebug=!1),{getApp:function(){if("object"===a(window.fbConfig)&&void 0!==window.fbConfig.apiKey)return t.initializeApp(fbConfig);console.error("Firebase config is not properly set and cannot create the app")},getOrCreateApp:function(e){if("object"===a(e))return e;if(void 0===(e=this.getApp()))throw new Error("Cannot get the app to create the db");return e},getAuth:function(e){var t=n.getAuth(this.getOrCreateApp(e));return f()&&function(e){null!==e.emulatorConfig||n.connectAuthEmulator(e,"".concat(s.publicUrl,":").concat(s.firebase.emulator.ports.authentication))}(t),t},getFirestore:function(e){var t=r.getFirestore(this.getOrCreateApp(e));return f()&&function(e){e._settings&&"firestore.googleapis.com"!==e._settings.host||r.connectFirestoreEmulator(e,s.cmsMainDomain,s.firebase.emulator.ports.firestore)}(t),t},getUserDetails:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAuth().currentUser;if(!t)return{};var n=t.displayName;if(!n)return{email:t.email,displayName:"",avatar:"",name:"",lastName:""};if(-1===n.indexOf("#")){var r=n.split(" ");n="".concat(r[0],"#").concat(r.slice(1).join(" "))}var i=n.split("#"),o=i[0],s=null!==(e=i[1])&&void 0!==e?e:"";return{email:t.email,displayName:i.join(" "),avatar:"".concat(o[0]).concat(s?s[0]:"").toLocaleUpperCase(),name:o,lastName:s}},createTextAvatar:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e.name&&"string"==typeof e.lastName){var t=e.name[0]||"",n=e.lastName[0]||"";return"".concat(t).concat(n).toLocaleUpperCase()}if("string"==typeof e.displayName){var r=e.displayName.replace("#"," ").split(" "),i=r[0][0].length?r[0][0]:"U",o=r[1]&&r[1][0]||"";return"".concat(i).concat(o).toLocaleUpperCase()}return"".concat("U").concat("").toLocaleUpperCase()},getUserAvatar:function(e){var t=this;return new Promise(function(n,r){e?t.getProfileData(e,e.auth.app).then(function(r){var i=r.photoUrl;if("string"!=typeof i&&(i=e.photoURL),"string"==typeof i&&i.length)n({type:"image",data:i});else{var o={name:r.name,lastName:r.lastName,displayName:e.displayName};n({type:"text",data:t.createTextAvatar(o)})}}).catch(function(e){n({type:"text",data:t.createTextAvatar()})}):r("Not identified")})},getCookie:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?atob(i.get(e)):i.get(e)},getLoggedUserCookie:function(){return this.getCookie(s.firebase.cookie_name)},getRegisterProcessCookie:function(){return this.getCookie(s.firebase.register_process_cookie_name)},getRecoverPasswordCookie:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCookie(s.firebase.recover_password_cookie_name,e)},getEmailCookie:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCookie(s.firebase.cookie_user_email,e)},isCookieSet:function(e){return void 0!==this.getCookie(e)},isLoggedUserCookieSet:function(){return this.isCookieSet(s.firebase.cookie_name)},isRegisterProcessCookieSet:function(){return this.isCookieSet(s.firebase.register_process_cookie_name)},isRecoverPasswordCookieSet:function(){return this.isCookieSet(s.firebase.recover_password_cookie_name)},setCookie:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;i.set(e,t,{expires:n,domain:window.location.hostname,secure:null!==window.location.protocol.match(/https/),sameSite:"strict"})},setLoggedUserCookie:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7;this.setCookie(s.firebase.cookie_name,e,t)},setRegisterProcessCookie:function(e){this.setCookie(s.firebase.register_process_cookie_name,e)},setRecoverPasswordCookie:function(e){this.setCookie(s.firebase.recover_password_cookie_name,e)},removeCookie:function(e){i.remove(e,{domain:window.location.hostname,secure:null!==window.location.protocol.match(/https/),sameSite:"strict"})},removeLoggedUserCookie:function(){this.removeCookie(s.firebase.cookie_name)},removeRegisterProcessCookie:function(){this.removeCookie(s.firebase.register_process_cookie_name)},removeRecoverPasswordCookie:function(){this.removeCookie(s.firebase.recover_password_cookie_name)},removeUserEMailCookie:function(){this.removeCookie(s.firebase.cookie_user_email)},redirectToPathName:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];"string"==typeof e&&e.length&&((e.indexOf("/")||e.indexOf("https"))&&e.indexOf("http")||(e="/"+e),t?window.location.pathname=e:window.location.href=e)},redirectToLogin:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e?this.redirectToPathName(s.firebase.routes.frontend.login+"?continueUrl="+e):this.redirectToPathName(s.firebase.routes.frontend.login)},redirectToRegister:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e?this.redirectToPathName(s.firebase.routes.frontend.register+"?continueUrl="+e):this.redirectToPathName(s.firebase.routes.frontend.register)},redirectToWelcome:function(){this.redirectToPathName(s.firebase.routes.frontend.register_welcome)},redirectToProfile:function(){this.redirectToPathName(s.firebase.routes.frontend.profile)},redirectToRecoverPassword:function(){this.redirectToPathName(s.firebase.routes.frontend.recover_password)},redirectToRecoverPasswordLinkSent:function(){this.redirectToPathName(s.firebase.routes.frontend.recover_password_link_sent)},redirectToResetPassword:function(){this.redirectToPathName(s.firebase.routes.frontend.reset_password)},redirectToChangePassword:function(){this.redirectToPathName(s.firebase.routes.frontend.change_password)},redirectToAccountDeleted:function(){this.redirectToPathName(s.firebase.routes.frontend.delete_account_success)},redirectToLogoutSuccess:function(){this.redirectToPathName(s.firebase.routes.frontend.logout_success)},redirectToOnboardingRoute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if("number"==typeof e&&e>=1&&e<=2){var t="step_"+e;this.redirectToPathName(s.firebase.routes.frontend.onboarding[t])}else this.redirectToProfile(s.firebase.routes.frontend.onboarding.step_1)},isRoute:function(e){return window.location.pathname===e},isLoginRoute:function(){return this.isRoute(s.firebase.routes.frontend.login)},isRegisterRoute:function(){return this.isRoute(s.firebase.routes.frontend.register)},isWelcomeRoute:function(){return this.isRoute(s.firebase.routes.frontend.register_welcome)},isPrivateAreaLanding:function(){return this.isRoute(s.firebase.routes.frontend.private_area)},isProfileRoute:function(){return this.isRoute(s.firebase.routes.frontend.profile)},isRecoverPasswordRoute:function(){return this.isRoute(s.firebase.routes.frontend.recover_password)},isRecoverPasswordLinkSentRoute:function(){return this.isRoute(s.firebase.routes.frontend.recover_password_link_sent)},isResetPasswordRoute:function(){return this.isRoute(s.firebase.routes.frontend.reset_password)},isChangePasswordRoute:function(){return this.isRoute(s.firebase.routes.frontend.change_password)},isDeleteAccountRoute:function(){return this.isRoute(s.firebase.routes.frontend.delete_account)},isBenefitsRoute:function(){return this.isRoute(s.firebase.routes.frontend.benefits)},isOnboardingRoute:function(){return this.isRoute(s.firebase.routes.frontend.onboarding.step_1)||this.isRoute(s.firebase.routes.frontend.onboarding.step_2)||this.isRoute(s.firebase.routes.frontend.onboarding.step_3)},isOnboardingNewslettersRoute:function(){return this.isRoute(s.firebase.routes.frontend.onboarding.step_1)},isOnboardingFavoritesRoute:function(){return this.isRoute(s.firebase.routes.frontend.onboarding.step_2)},isOnboardingBenefitsRoute:function(){return this.isRoute(s.firebase.routes.frontend.onboarding.step_3)},isCommentsRoute:function(){return this.isRoute(s.firebase.routes.frontend.comments)},isFavoritesNewsRoute:function(){return this.isRoute(s.firebase.routes.frontend.favorites)},isFavoritesAuthorsRoute:function(){return this.isRoute(s.firebase.routes.frontend.subscriptions)},isNewslettersRoute:function(){return this.isRoute(s.firebase.routes.frontend.newsletters)},isCollaborateRoute:function(){return this.isRoute(s.firebase.routes.frontend.collaborate)},isMenuRoute:function(){return this.isPrivateAreaLanding()||this.isProfileRoute()||this.isCommentsRoute()||this.isFavoritesNewsRoute()||this.isFavoritesAuthorsRoute()||this.isNewslettersRoute
1()||this.isBenefitsRoute()||this.isCollaborateRoute()},signInWithCredentials:function(e,t,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise(function(s,a){var u={displayName:e,email:t,password:r,personalData:o},l=btoa(JSON.stringify(u)),c={url:"".concat(window.location.protocol,"//").concat(window.location.host,"/profile/validation/").concat(l),handleCodeInApp:!0},h=i.getAuth();n.sendSignInLinkToEmail(h,t,c).then(function(){s(u)}).catch(function(e){a("register no ok")})})},addRelationType:function(e){return this.getRelationIdPromise(e).then(function(t){return u.toggleRelationType(e,"create",t)})},removeRelationType:function(e,t){return this.getRelationIdPromise(e).then(function(t){return u.toggleRelationType(e,"delete",t)})},hasRelationPromise:function(e,t){return this.getRelationIdPromise(e).then(function(n){return u.hasRelationIdPromise(e,t,n)})},getRelationIdPromise:function(e){return"favorites"===e?h.getFavoriteId():"subscriptions"===e?h.getSubscriptionId():Promise.reject("Unable to find id for relation ".concat(e))},removeBackendRelation:function(e){var t=this.getAuth().currentUser;if(!t)return!1;this.removeRelationType(e,t.uid).then(function(e){console.log(e)}).catch(function(e){console.error(e)})},saveBackendRelation:function(e){return!!this.getAuth().currentUser&&(this.addRelationType(e).then(function(e){console.log(e)}).catch(function(e){console.error(e)}),!0)},utf8_to_b64:function(e){return btoa((new TextEncoder).encode(e).reduce(function(e,t){return e+String.fromCharCode(t)},""))},afterAction:function(e){var t={};return t[s.firebase.register_process_user_data]=this.utf8_to_b64(JSON.stringify(e)),fetch(s.firebase.routes.backend.user.after_process,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)})},setPasswordVisibilityToggle:function(){e(document).on("click",".input-password-eye",function(t){e(this).toggleClass("hide-pass");var n=e(this).prev("input").get(0);if(n){var r="text";"text"===n.getAttribute("type")&&(r="password"),n.setAttribute("type",r)}})},setCheckboxes:function(){e(document).on("click",".fake-check",function(t){e(this).prev('input[type="checkbox"]').trigger("click")})},setTabLinks:function(){e(document).on("click","#login-link, #register-link",function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget;if(!t.getAttribute("href").includes("#")&&window.location.hash){var n=t.getAttribute("href")+"".concat(window.location.hash);t.setAttribute("href",n)}window.location.href=t.getAttribute("href")})},logout:function(){var e=this;return new Promise(function(t,n){var r=e.getAuth();r.currentUser?r.signOut().then(function(){h.clearAllBrowserCache().then(function(){}).catch(function(e){}),e.stopWatchProfileChanges(),e.removeLoggedUserCookie(),e.removeUserEMailCookie(),e.dropUserCache(),sessionStorage.removeItem("hasRedirectedToProfile"),window.paChannel&&window.paChannel.postMessage("logout"),t(!0)}).catch(function(e){n(e)}):n(!1)})},getProviderUrlToRedirect:function(){var e=this;return new Promise(function(t,n){var r=new URLSearchParams(window.location.search),i=r.get("referer_url"),o="";if(i)try{o=atob(i)}catch(e){o=""}var a=r.get(s.firebase.provider_param);if(d("[Firebase Auth] getProviderUrlToRedirect - pr:",a,"refererUrl:",o),!a)return d("[Firebase Auth] getProviderUrlToRedirect - No provider param, rejecting"),void n("No provider");try{d("[Firebase Auth] getProviderUrlToRedirect - decoded pr:",atob(a))}catch(e){d("[Firebase Auth] getProviderUrlToRedirect - pr is not valid base64")}d("[Firebase Auth] getProviderUrlToRedirect - calling getProviderRedirect"),e.getProviderRedirect(a,o).then(function(e){d("[Firebase Auth] getProviderUrlToRedirect - getProviderRedirect resolved with:",e),t(e)}).catch(function(e){if(d("[Firebase Auth] getProviderUrlToRedirect - getProviderRedirect rejected:",e),e&&"incomplete_profile"===e.code){var t=s.firebase.routes.frontend.profile+"?incomplete_profile=1&"+s.firebase.provider_param+"="+encodeURIComponent(a);return i&&(t+="&referer_url="+encodeURIComponent(i)),d("[Firebase Auth] getProviderUrlToRedirect - incomplete profile, redirecting to:",t),void(window.location.href=t)}n(e)})})},getProviderRedirect:function(e,t){var n=this;return new Promise(function(r,i){var a=n.getAuth();if(a.currentUser){var u=o((a.currentUser.displayName||"").split("#"),2),l=u[0],c=void 0===l?"":l,h=u[1],d=void 0===h?"":h,f=s.firebase.provider_param;n.getProfileDataFresh(a.currentUser).then(function(n){var o={};o[f]=e;var u=n.name||c||"",l=n.lastName||d||"";u&&l?(o.payload={uuid:a.currentUser.uid,firstname:u,lastName:l,email:a.currentUser.email,category:"General",referer_url:t,main_address:{firstname:u,lastname:l,telephone:n.telep
1hone||"",street:n.street||"",postcode:n.zipCode||"",city:n.city||"",country_id:n.country||"",region:n.region||""}},fetch(s.firebase.routes.backend.providers.oauth_route_generate,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)}).then(function(e){return e.json()}).then(function(e){e.url?r(e.url):i(e.error||"No se recibió URL")}).catch(function(e){i(e)})):i({code:"incomplete_profile"})}).catch(function(e){i("No se pudo cargar el perfil")})}else i("Not identified")})},getDoc:function(e){var t=this;return new Promise(function(n,i){if("object"===a(e)&&e.constructor&&e.constructor.name===r.DocumentReference.name){var o=window.localStorage.getItem(e.path);o?n(JSON.parse(o)):r.getDoc(e).then(function(r){var i={};r.exists()&&(i=r.data()),window.localStorage.setItem(e.path,JSON.stringify(i)),window.localStorage.setItem("extraDataUser",JSON.stringify(t.getExtraDataUser())),n(i)}).catch(function(e){i(e)})}else i("Invalid document reference")})},setDoc:function(e,t){var n=this;return new Promise(function(i,o){"object"===a(e)&&e.constructor&&e.constructor.name===r.DocumentReference.name?r.setDoc(e,t,{merge:!0}).then(function(){var r=window.localStorage.getItem(e.path);if(r)try{var o=(r=JSON.parse(r)).alias!==t.alias,s=Object.assign({},r,t);window.localStorage.setItem(e.path,JSON.stringify(s)),o&&(window.localStorage.removeItem("htParams"),n.getHyvorTalkParams().then(function(e){}).catch(function(e){}),window.paChannel&&window.paChannel.postMessage("alias-changed"))}catch(t){window.localStorage.removeItem(e.path)}i(t)}).catch(function(e){o(e)}):o("Invalid document reference")})},getProfileData:function(e,t){var n=this;return new Promise(function(i,o){var s=n.getFirestore(t),a=r.doc(s,"users",e.uid);n.getDoc(a).then(function(e){i(e)}).catch(function(e){o(e)})})},getProfileDataFresh:function(e,t){var n=this;return new Promise(function(i,o){var s=n.getFirestore(t),a=r.doc(s,"users",e.uid);r.getDoc(a).then(function(e){var t={};e.exists()&&(t=e.data()),window.localStorage.setItem(a.path,JSON.stringify(t)),window.localStorage.setItem("extraDataUser",JSON.stringify(n.getExtraDataUser())),i(t)}).catch(function(e){o(e)})})},getHyvorTalkParams:function(){var e=this;return new Promise(function(t,n){var r=e.getAuth().currentUser;if(r){var i=window.localStorage.getItem("htParams");i?t(JSON.parse(i)):e.getProfileData(r,r.auth.app).then(function(e){if(i={uid:r.uid,email:r.email},"string"==typeof e.alias&&e.alias.length)i.alias=e.alias;else{var n=r.displayName;e.name&&e.lastName&&(n="".concat(e.name," ").concat(e.lastName)),i.alias=n}window.localStorage.setItem("htParams",JSON.stringify(i)),t(i)}).catch(function(e){n(e)})}else n("Not identified")})},dropUserCache:function(){var e=window.localStorage.getItem("dbtUid");e&&window.localStorage.removeItem("users/".concat(e)),window.localStorage.removeItem("dbtAvatar"),window.localStorage.removeItem("dbtUid"),window.localStorage.removeItem("htParams")},watchProfileChanges:function(e){if(e&&e.uid){this.stopWatchProfileChanges();var t=this.getFirestore(),n=r.doc(t,"users",e.uid),i=this;window._profileSnapshotUnsub=r.onSnapshot(n,{includeMetadataChanges:!1},function(t){if(t.exists()&&!t.metadata.hasPendingWrites){var n=t.data(),r="users/"+e.uid,o=window.localStorage.getItem(r),s=!0;if(o)try{var a=JSON.parse(o);s=JSON.stringify(a)!==JSON.stringify(n)}catch(e){s=!0}s&&(window.localStorage.setItem(r,JSON.stringify(n)),window.localStorage.setItem("extraDataUser",JSON.stringify(i.getExtraDataUser())),window.localStorage.removeItem("htParams"))}},function(e){})}},stopWatchProfileChanges:function(){"function"==typeof window._profileSnapshotUnsub&&(window._profileSnapshotUnsub(),window._profileSnapshotUnsub=null)},getExtraDataUser:function(){var e,t={};return t.metadata=null===(e=this.getAuth())||void 0===e||null===(e=e.currentUser)||void 0===e?void 0:e.metadata,null==t.metadata&&(t.metadata={createdAt:(new Date).getTime(),creationTime:"",lastLoginAt:(new Date).getTime(),lastSignInTime:""}),t},setDatalayer:function(e){var t=this;e&&this.getProfileData(e,e.auth.app).then(function(e){if("undefined"!=typeof dataLayer){var n,r,i="no-data",o="no-data";"socialMedia"in e&&void 0!==e.socialMedia&&(i=e.socialMedia),"zipCode"in e&&void 0!==e.zipCode&&(o=e.zipCode);var s=new Date(parseInt(t.getExtraDataUser().metadata.createdAt)),a=new Date,u=Math.abs(a-s),l=s.getMonth()+1;n=(s.getFullYear()+" "+("0"+l).slice(-2)+" "+("0"+s.getDate()).slice(-2)).replace(/ /g,""),r=Math.floor(u/864e5),dataLayer.push({db_rolus:"registrado"}),dataLayer.push({db_creg:i}),dataLayer.push({db_cpos:o}),dataLayer.push({db_faltreg:n}),dataLayer.push({db_dreg:r}),dataLayer[0].db_rolus="registrado",dataLayer[0].db_creg=i,dataLayer[0].db_cpos=o,dataLayer[0].db_faltreg=n,dataLayer[0].db_dreg=r}})}}}.apply(t,r))||(e.exports=i)},27:function(e,t,n){var r;(function(){var n=this,i=n._,o={},s=Array.prototype,a=Object.prototype,u=Function.prototype,l=s.push,c=s.slice,h=s.concat,d=a.toString,f=a.hasOwnProperty,p=s.forEach,m=s.map,g=s.reduce,_=s.reduceRight,y=s.filter,v=s.every,b=s.some,w=s.indexOf,I=s.lastIndexOf,T=Array.isArray,E=Object.keys,S=u.bind,A=function(e){return e instanceof A?e:this instanceof A?void(this._wrapped=e):new A(e)};e.exports&&(t=e.exports=A),t._=A,A.VERSION="1.6.0";var C=A.each=A.forEach=function(e,t,n){if(null==e)return e;if(p&&e.forEach===p)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e)===o)return}else{var s=A.keys(e);for(r=0,i=s.length;r<i;r++)if(t.call(n,e[s[r]],s[r],e)===o)return}return e};A.map=A.collect=function(e,t,n){var r=[];return null==e?r:m&&e.map===m?e.map(t,n):(C(e,function(e,i,o){r.push(t.call(n,e,i,o))}),r)};
1var k="Reduce of empty array with no initial value";A.reduce=A.foldl=A.inject=function(e,t,n,r){var i=arguments.length>2;if(null==e&&(e=[]),g&&e.reduce===g)return r&&(t=A.bind(t,r)),i?e.reduce(t,n):e.reduce(t);if(C(e,function(e,o,s){i?n=t.call(r,n,e,o,s):(n=e,i=!0)}),!i)throw new TypeError(k);return n},A.reduceRight=A.foldr=function(e,t,n,r){var i=arguments.length>2;if(null==e&&(e=[]),_&&e.reduceRight===_)return r&&(t=A.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var o=e.length;if(o!==+o){var s=A.keys(e);o=s.length}if(C(e,function(a,u,l){u=s?s[--o]:--o,i?n=t.call(r,n,e[u],u,l):(n=e[u],i=!0)}),!i)throw new TypeError(k);return n},A.find=A.detect=function(e,t,n){var r;return x(e,function(e,i,o){if(t.call(n,e,i,o))return r=e,!0}),r},A.filter=A.select=function(e,t,n){var r=[];return null==e?r:y&&e.filter===y?e.filter(t,n):(C(e,function(e,i,o){t.call(n,e,i,o)&&r.push(e)}),r)},A.reject=function(e,t,n){return A.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},A.every=A.all=function(e,t,n){t||(t=A.identity);var r=!0;return null==e?r:v&&e.every===v?e.every(t,n):(C(e,function(e,i,s){if(!(r=r&&t.call(n,e,i,s)))return o}),!!r)};var x=A.some=A.any=function(e,t,n){t||(t=A.identity);var r=!1;return null==e?r:b&&e.some===b?e.some(t,n):(C(e,function(e,i,s){if(r||(r=t.call(n,e,i,s)))return o}),!!r)};A.contains=A.include=function(e,t){return null!=e&&(w&&e.indexOf===w?-1!=e.indexOf(t):x(e,function(e){return e===t}))},A.invoke=function(e,t){var n=c.call(arguments,2),r=A.isFunction(t);return A.map(e,function(e){return(r?t:e[t]).apply(e,n)})},A.pluck=function(e,t){return A.map(e,A.property(t))},A.where=function(e,t){return A.filter(e,A.matches(t))},A.findWhere=function(e,t){return A.find(e,A.matches(t))},A.max=function(e,t,n){if(!t&&A.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);var r=-1/0,i=-1/0;return C(e,function(e,o,s){var a=t?t.call(n,e,o,s):e;a>i&&(r=e,i=a)}),r},A.min=function(e,t,n){if(!t&&A.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);var r=1/0,i=1/0;return C(e,function(e,o,s){var a=t?t.call(n,e,o,s):e;a<i&&(r=e,i=a)}),r},A.shuffle=function(e){var t,n=0,r=[];return C(e,function(e){t=A.random(n++),r[n-1]=r[t],r[t]=e}),r},A.sample=function(e,t,n){return null==t||n?(e.length!==+e.length&&(e=A.values(e)),e[A.random(e.length-1)]):A.shuffle(e).slice(0,Math.max(0,t))};var N=function(e){return null==e?A.identity:A.isFunction(e)?e:A.property(e)};A.sortBy=function(e,t,n){return t=N(t),A.pluck(A.map(e,function(e,r,i){return{value:e,index:r,criteria:t.call(n,e,r,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index}),"value")};var D=function(e){return function(t,n,r){var i={};return n=N(n),C(t,function(o,s){var a=n.call(r,o,s,t);e(i,a,o)}),i}};A.groupBy=D(function(e,t,n){A.has(e,t)?e[t].push(n):e[t]=[n]}),A.indexBy=D(function(e,t,n){e[t]=n}),A.countBy=D(function(e,t){A.has(e,t)?e[t]++:e[t]=1}),A.sortedIndex=function(e,t,n,r){for(var i=(n=N(n)).call(r,t),o=0,s=e.length;o<s;){var a=o+s>>>1;n.call(r,e[a])<i?o=a+1:s=a}return o},A.toArray=function(e){return e?A.isArray(e)?c.call(e):e.length===+e.length?A.map(e,A.identity):A.values(e):[]},A.size=function(e){return null==e?0:e.length===+e.length?e.length:A.keys(e).length},A.first=A.head=A.take=function(e,t,n){if(null!=e)return null==t||n?e[0]:t<0?[]:c.call(e,0,t)},A.initial=function(e,t,n){return c.call(e,0,e.length-(null==t||n?1:t))},A.last=function(e,t,n){if(null!=e)return null==t||n?e[e.length-1]:c.call(e,Math.max(e.length-t,0))},A.rest=A.tail=A.drop=function(e,t,n){return c.call(e,null==t||n?1:t)},A.compact=function(e){return A.filter(e,A.identity)};var O=function(e,t,n){return t&&A.every(e,A.isArray)?h.apply(n,e):(C(e,function(e){A.isArray(e)||A.isArguments(e)?t?l.apply(n,e):O(e,t,n):n.push(e)}),n)};A.flatten=function(e,t){return O(e,t,[])},A.without=function(e){return A.difference(e,c.call(arguments,1))},A.partition=function(e,t){var n=[],r=[];return C(e,function(e){(t(e)?n:r).push(e)}),[n,r]},A.uniq=A.unique=function(e,t,n,r){A.isFunction(t)&&(r=n,n=t,t=!1);var i=n?A.map(e,n,r):e,o=[],s=[];return C(i,function(n,r){(t?r&&s[s.length-1]===n:A.contains(s,n))||(s.push(n),o.push(e[r]))}),o},A.union=function(){return A.uniq(A.flatten(arguments,!0))}
1,A.intersection=function(e){var t=c.call(arguments,1);return A.filter(A.uniq(e),function(e){return A.every(t,function(t){return A.contains(t,e)})})},A.difference=function(e){var t=h.apply(s,c.call(arguments,1));return A.filter(e,function(e){return!A.contains(t,e)})},A.zip=function(){for(var e=A.max(A.pluck(arguments,"length").concat(0)),t=new Array(e),n=0;n<e;n++)t[n]=A.pluck(arguments,""+n);return t},A.object=function(e,t){if(null==e)return{};for(var n={},r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},A.indexOf=function(e,t,n){if(null==e)return-1;var r=0,i=e.length;if(n){if("number"!=typeof n)return e[r=A.sortedIndex(e,t)]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(w&&e.indexOf===w)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},A.lastIndexOf=function(e,t,n){if(null==e)return-1;var r=null!=n;if(I&&e.lastIndexOf===I)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);for(var i=r?n:e.length;i--;)if(e[i]===t)return i;return-1},A.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((t-e)/n),0),i=0,o=new Array(r);i<r;)o[i++]=e,e+=n;return o};var R=function(){};A.bind=function(e,t){var n,r;if(S&&e.bind===S)return S.apply(e,c.call(arguments,1));if(!A.isFunction(e))throw new TypeError;return n=c.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(c.call(arguments)));R.prototype=e.prototype;var i=new R;R.prototype=null;var o=e.apply(i,n.concat(c.call(arguments)));return Object(o)===o?o:i}},A.partial=function(e){var t=c.call(arguments,1);return function(){for(var n=0,r=t.slice(),i=0,o=r.length;i<o;i++)r[i]===A&&(r[i]=arguments[n++]);for(;n<arguments.length;)r.push(arguments[n++]);return e.apply(this,r)}},A.bindAll=function(e){var t=c.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return C(t,function(t){e[t]=A.bind(e[t],e)}),e},A.memoize=function(e,t){var n={};return t||(t=A.identity),function(){var r=t.apply(this,arguments);return A.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},A.delay=function(e,t){var n=c.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},A.defer=function(e){return A.delay.apply(A,[e,1].concat(c.call(arguments,1)))},A.throttle=function(e,t,n){var r,i,o,s=null,a=0;n||(n={});var u=function(){a=!1===n.leading?0:A.now(),s=null,o=e.apply(r,i),r=i=null};return function(){var l=A.now();a||!1!==n.leading||(a=l);var c=t-(l-a);return r=this,i=arguments,c<=0?(clearTimeout(s),s=null,a=l,o=e.apply(r,i),r=i=null):s||!1===n.trailing||(s=setTimeout(u,c)),o}},A.debounce=function(e,t,n){var r,i,o,s,a,u=function(){var l=A.now()-s;l<t?r=setTimeout(u,t-l):(r=null,n||(a=e.apply(o,i),o=i=null))};return function(){o=this,i=arguments,s=A.now();var l=n&&!r;return r||(r=setTimeout(u,t)),l&&(a=e.apply(o,i),o=i=null),a}},A.once=function(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(this,arguments),e=null),t}},A.wrap=function(e,t){return A.partial(t,e)},A.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},A.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},A.keys=function(e){if(!A.isObject(e))return[];if(E)return E(e);var t=[];for(var n in e)A.has(e,n)&&t.push(n);return t},A.values=function(e){for(var t=A.keys(e),n=t.length,r=new Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r},A.pairs=function(e){for(var t=A.keys(e),n=t.length,r=new Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},A.invert=function(e){for(var t={},n=A.keys(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},A.functions=A.methods=function(e){var t=[];for(var n in e)A.isFunction(e[n])&&t.push(n);return t.sort()},A.extend=function(e){return C(c.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},A.pick=function(e){var t={},n=h.apply(s,c.call(arguments,1));return C(n,function(n){n in e&&(t[n]=e[n])}),t},A.omit=function(e){var t={},n=h.apply(s,c.call(arguments,1));for(var r in e)A.contains(n,r)||(t[r]=e[r]);return t},A.defaults=function(e){return C(c.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e},A.clone=function(e){return A.isObject(e)?A.isArray(e)?e.slice():A.extend({},e):e},A.tap=function(e,t){return t(e),e};var P=function(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof A&&(e=e._wrapped),t instanceof A&&(t=t._wrapped);var i=d.call(e);
1if(i!=d.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var o=n.length;o--;)if(n[o]==e)return r[o]==t;var s=e.constructor,a=t.constructor;if(s!==a&&!(A.isFunction(s)&&s instanceof s&&A.isFunction(a)&&a instanceof a)&&"constructor"in e&&"constructor"in t)return!1;n.push(e),r.push(t);var u=0,l=!0;if("[object Array]"==i){if(l=(u=e.length)==t.length)for(;u--&&(l=P(e[u],t[u],n,r)););}else{for(var c in e)if(A.has(e,c)&&(u++,!(l=A.has(t,c)&&P(e[c],t[c],n,r))))break;if(l){for(c in t)if(A.has(t,c)&&!u--)break;l=!u}}return n.pop(),r.pop(),l};A.isEqual=function(e,t){return P(e,t,[],[])},A.isEmpty=function(e){if(null==e)return!0;if(A.isArray(e)||A.isString(e))return 0===e.length;for(var t in e)if(A.has(e,t))return!1;return!0},A.isElement=function(e){return!(!e||1!==e.nodeType)},A.isArray=T||function(e){return"[object Array]"==d.call(e)},A.isObject=function(e){return e===Object(e)},C(["Arguments","Function","String","Number","Date","RegExp"],function(e){A["is"+e]=function(t){return d.call(t)=="[object "+e+"]"}}),A.isArguments(arguments)||(A.isArguments=function(e){return!(!e||!A.has(e,"callee"))}),A.isFunction=function(e){return"function"==typeof e},A.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},A.isNaN=function(e){return A.isNumber(e)&&e!=+e},A.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"==d.call(e)},A.isNull=function(e){return null===e},A.isUndefined=function(e){return void 0===e},A.has=function(e,t){return f.call(e,t)},A.noConflict=function(){return n._=i,this},A.identity=function(e){return e},A.constant=function(e){return function(){return e}},A.property=function(e){return function(t){return t[e]}},A.matches=function(e){return function(t){if(t===e)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0}},A.times=function(e,t,n){for(var r=Array(Math.max(0,e)),i=0;i<e;i++)r[i]=t.call(n,i);return r},A.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},A.now=Date.now||function(){return(new Date).getTime()};var L={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};L.unescape=A.invert(L.escape);var j={escape:new RegExp("["+A.keys(L.escape).join("")+"]","g"),unescape:new RegExp("("+A.keys(L.unescape).join("|")+")","g")};A.each(["escape","unescape"],function(e){A[e]=function(t){return null==t?"":(""+t).replace(j[e],function(t){return L[e][t]})}}),A.result=function(e,t){if(null!=e){var n=e[t];return A.isFunction(n)?n.call(e):n}},A.mixin=function(e){C(A.functions(e),function(t){var n=A[t]=e[t];A.prototype[t]=function(){var e=[this._wrapped];return l.apply(e,arguments),z.call(this,n.apply(A,e))}})};var q=0;A.uniqueId=function(e){var t=++q+"";return e?e+t:t},A.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var M=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\t|\u2028|\u2029/g;A.template=function(e,t,n){var r;n=A.defaults({},n,A.templateSettings);var i=new RegExp([(n.escape||M).source,(n.interpolate||M).source,(n.evaluate||M).source].join("|")+"|$","g"),o=0,s="__p+='";e.replace(i,function(t,n,r,i,a){return s+=e.slice(o,a).replace(U,function(e){return"\\"+F[e]}),n&&(s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(s+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(s+="';\n"+i+"\n__p+='"),o=a+t.length,t}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(n.variable||"obj","_",s)}catch(e){throw e.source=s,e}if(t)return r(t,A);var a=function(e){return r.call(this,e,A)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},A.chain=function(e){return A(e).chain()};var z=function(e){return this._chain?A(e).chain():e};A.mixin(A),C(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=s[e];A.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!=e&&"splice"!=e||0!==n.length||delete n[0],z.call(this,n)}}),C(["concat","join","slice"],function(e){var t=s[e];A.prototype[e]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),A.extend(A.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),void 0===(r=function(){return A}
1.apply(t,[]))||(e.exports=r)}).call(this)},3:function(e,t,n){"use strict";n.r(t),n.d(t,"FirebaseError",function(){return o.c}),n.d(t,"SDK_VERSION",function(){return U}),n.d(t,"_DEFAULT_ENTRY_NAME",function(){return E}),n.d(t,"_addComponent",function(){return x}),n.d(t,"_addOrOverwriteComponent",function(){return N}),n.d(t,"_apps",function(){return A}),n.d(t,"_clearComponents",function(){return j}),n.d(t,"_components",function(){return k}),n.d(t,"_getProvider",function(){return O}),n.d(t,"_isFirebaseApp",function(){return P}),n.d(t,"_isFirebaseServerApp",function(){return L}),n.d(t,"_registerComponent",function(){return D}),n.d(t,"_removeServiceInstance",function(){return R}),n.d(t,"_serverApps",function(){return C}),n.d(t,"deleteApp",function(){return H}),n.d(t,"getApp",function(){return B}),n.d(t,"getApps",function(){return G}),n.d(t,"initializeApp",function(){return z}),n.d(t,"initializeServerApp",function(){return V}),n.d(t,"onLog",function(){return $}),n.d(t,"registerVersion",function(){return K}),n.d(t,"setLogLevel",function(){return W});var r=n(7),i=n(6),o=n(1);let s,a;const u=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakMap,d=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return l.get(e);if("objectStoreNames"===t)return e.objectStoreNames||c.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return m(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){return"function"==typeof e?function(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(g(this),t),m(u.get(this))}:function(...t){return m(e.apply(g(this),t))}:function(t,...n){const r=e.call(g(this),t,...n);return c.set(r,t.sort?t.sort():[t]),m(r)}}(e):(e instanceof IDBTransaction&&function(e){if(l.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});l.set(e,t)}(e),t=e,(s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,f):e);var t}function m(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(m(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",o)});return t.then(t=>{t instanceof IDBCursor&&u.set(t,e)}).catch(()=>{}),d.set(t,e),t}(e);if(h.has(e))return h.get(e);const t=p(e);return t!==e&&(h.set(e,t),d.set(t,e)),t}const g=e=>d.get(e),_=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],v=new Map;function b(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!_.includes(n))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),i&&o.done]))[0]};return v.set(t,o),o}f=(e=>({...e,get:(t,n,r)=>b(t,n)||e.get(t,n,r),has:(t,n)=>!!b(t,n)||e.has(t,n)}))(f);class w{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const I="@firebase/app",T=new i.b("@firebase/app"),E="[DEFAULT]",S={[I]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/vertexai-preview":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},A=new Map,C=new Map,k=new Map;function x(e,t){try{e.container.addComponent(t)}catch(n){T.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function N(e,t){e.container.addOrOverwriteComponent(t)}function D(e){const t=e.name;if(k.has(t))return T.debug(`There were multiple attempts to register component ${t}.`),!1;k.set(t,e);for(const t of A.values())x(t,e);for(const t of C.values())x(t,e);return!0}function O(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function R(e,t,n=E){O(e,t).clearInstance(n)}function P(e){return void 0!==e.options}function L(e){return void 0!==e.settings}function j(){k.clear()}const q=new o.b("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invali
1d-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class M{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.a("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw q.create("app-deleted",{appName:this._name})}}class F extends M{constructor(e,t,n,r){const i=void 0!==t.automaticDataCollectionEnabled&&t.automaticDataCollectionEnabled,o={name:n,automaticDataCollectionEnabled:i};void 0!==e.apiKey?super(e,o,r):super(e.options,o,r),this._serverConfig=Object.assign({automaticDataCollectionEnabled:i},t),this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()}),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,t.releaseOnDeref=void 0,K(I,"0.10.4","serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,void 0!==e&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){H(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw q.create("server-app-deleted")}}const U="10.12.1";function z(e,t={}){let n=e;"object"!=typeof t&&(t={name:t});const i=Object.assign({name:E,automaticDataCollectionEnabled:!1},t),s=i.name;if("string"!=typeof s||!s)throw q.create("bad-app-name",{appName:String(s)});if(n||(n=Object(o.l)()),!n)throw q.create("no-options");const a=A.get(s);if(a){if(Object(o.i)(n,a.options)&&Object(o.i)(i,a.config))return a;throw q.create("duplicate-app",{appName:s})}const u=new r.b(s);for(const e of k.values())u.addComponent(e);const l=new M(n,i,u);return A.set(s,l),l}function V(e,t){if(Object(o.r)())throw q.create("invalid-server-app-environment");let n;void 0===t.automaticDataCollectionEnabled&&(t.automaticDataCollectionEnabled=!1),n=P(e)?e.options:e;const i=Object.assign(Object.assign({},t),n);if(void 0!==i.releaseOnDeref&&delete i.releaseOnDeref,void 0!==t.releaseOnDeref&&"undefined"==typeof FinalizationRegistry)throw q.create("finalization-registry-not-supported",{});const s=""+(a=JSON.stringify(i),[...a].reduce((e,t)=>Math.imul(31,e)+t.charCodeAt(0)|0,0));var a;const u=C.get(s);if(u)return u.incRefCount(t.releaseOnDeref),u;const l=new r.b(s);for(const e of k.values())l.addComponent(e);const c=new F(n,t,s,l);return C.set(s,c),c}function B(e=E){const t=A.get(e);if(!t&&e===E&&Object(o.l)())return z();if(!t)throw q.create("no-app",{appName:e});return t}function G(){return Array.from(A.values())}async function H(e){let t=!1;const n=e.name;A.has(n)?(t=!0,A.delete(n)):C.has(n)&&e.decRefCount()<=0&&(C.delete(n),t=!0),t&&(await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function K(e,t,n){var i;let o=null!==(i=S[e])&&void 0!==i?i:e;n&&(o+="-"+n);const s=o.match(/\s|\//),a=t.match(/\s|\//);if(s||a){const e=[`Unable to register library "${o}" with version "${t}":`];return s&&e.push(`library name "${o}" contains illegal characters (whitespace or "/")`),s&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void T.warn(e.join(" "))}D(new r.a(o+"-version",()=>({library:o,version:t}),"VERSION"))}function $(e,t){if(null!==e&&"function"!=typeof e)throw q.create("invalid-log-argument");Object(i.d)(e,t)}function W(e){Object(i.c)(e)}const Q="firebase-heartbeat-store";let Y=null;function J(){return Y||(Y=function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=m(s);return r&&s.addEventListener("upgradeneeded",e=>{r(m(s.result),e.oldVersion,e.newVersion,m(s.transaction),e)}),n&&s.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{o&&e.addEventListener("close",()=>o()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(Q)}catch(e){console.warn(e)}}}).catch(e=>{throw q.create("idb-open",{originalErrorMessage:e.message})})),Y}async function X(e,t){try{const n=(await J()).transaction(Q,"readwrite"),r=n.objectStore(Q);await r.put(t,Z(e)),await n.done}catch(e){if(e instanceof o.c)T.warn(e.message);else{const t=q.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});T.warn(t.message)}}}function Z(e){return`${e.name}!${e.options.appId}`}class ee{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new ne(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=te();if((null!=(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||(this._heartbeatsCache=await this._heartbeatsCachePromise,null!=(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))&&this._heartbeatsCache.lastSentHeartbeatDate!==r&&!this._heartbeatsCache.heartbeats.some(e=>e.date===r))return this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";
1const t=te(),{heartbeatsToSend:n,unsentEntries:r}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find(e=>e.agent===i.agent);if(e){if(e.dates.push(i.date),re(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),re(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),i=Object(o.e)(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function te(){return(new Date).toISOString().substring(0,10)}class ne{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!Object(o.v)()&&Object(o.C)().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await J()).transaction(Q),n=await t.objectStore(Q).get(Z(e));return await t.done,n}catch(e){if(e instanceof o.c)T.warn(e.message);else{const t=q.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});T.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return X(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return X(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function re(e){return Object(o.e)(JSON.stringify({version:2,heartbeats:e})).length}D(new r.a("platform-logger",e=>new w(e),"PRIVATE")),D(new r.a("heartbeat",e=>new ee(e),"PRIVATE")),K(I,"0.10.4",""),K(I,"0.10.4","esm2017"),K("fire-js","")},31:function(e,t,n){"use strict";(function(e){var r=n(34),i=n(35),o=n(36);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),i=(e=a(e,r)).write(t,n);return i!==r&&(e=e.slice(0,i)),e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|f(t.length);return 0===(e=a(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?a(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(c(t),e=a(e,t<0?0:0|f(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|f(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function f(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&
vendor: 16,455 bytes, line 1
1(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=n;o<a;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var h=!0,d=0;d<u;d++)if(l(e,o+d)!==l(t,d)){h=!1;break}if(h)return o}return-1}function v(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function b(e,t,n,r){return V(U(t,e.length-n),e,n,r)}function w(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function I(e,t,n,r){return w(e,t,n,r)}function T(e,t,n,r){return V(z(t),e,n,r)}function E(e,t,n,r){return V(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,l=e[i],c=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=n)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function k(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function x(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=F(e[o]);return i}function N(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function D(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function P(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,o){return o||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,o){return o||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return l(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return h(null,e)},u.allocUnsafeSlow=function(e){return h(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):m.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),l=this.slice(r,i),c=e.slice(t,n),h=0;h<a;++h)if(l[h]!==c[h]){o=l[h],s=c[h];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return _(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return _(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return I(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=u.isBuffer(e)?e:U(new u(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var M=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>
1-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(10))},32:function(e,t,n){var r,i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r=[n(12),n(15)],void 0===(i=function(e,t){var n=e.firebase.routes;return{toggleRelationType:function(e,r,i){if(-1===["create","delete"].indexOf(r))return Promise.reject("Unsupported action ".concat(r," for relation ").concat(e));if("object"!==o(n.backend[e])||"string"!=typeof n.backend[e][r])return Promise.reject("Cannot add relation of type ".concat(e," and action ").concat(r,", URL not found"));var s=n.backend[e][r].replace("__id__",i.id);return fetch(s,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(n){return n.json().then(function(o){if(200===n.status){if("false"===window.enableBrowserCache)return o;t.addRelation(e,r,i).then(function(e){return o}
1).catch(function(e){return Promise.reject(o)})}})})},hasRelationIdPromise:function(e,r,i){var s=n.backend.user.has.replace("__uuid__",r).replace("__relation__",e).replace("__id__",i.id),a={Accept:"application/json","Content-Type":"application/json"};return"false"===window.enableBrowserCache?fetch(s,{method:"POST",headers:a}).then(function(t){return t.json().then(function(n){return 200!==t.status?Promise.reject("Error fetching relation type ".concat(e," for user}")):"object"!==o(n)||void 0===n.exists?Promise.reject("Unexpected response fetching relation type ".concat(e)):n.exists})}):t.getRelationship(i.slug,e).then(function(n){return n||fetch(s,{method:"POST",headers:a}).then(function(n){return n.json().then(function(r){return 200!==n.status?Promise.reject("Error fetching relation type ".concat(e," for user}")):"object"!==o(r)||void 0===r.exists?Promise.reject("Unexpected response fetching relation type ".concat(e)):"false"===window.enableBrowserCache?r.exists:r.exists?t.setRelationship(i.slug,{id:i.id,related:!0},e).then(function(e){return r.exists}):t.setRelationship(i.slug,{id:i.id,related:!1},e).then(function(e){return r.exists})})})})}}}.apply(t,r))||(e.exports=i)},33:function(e,t,n){(function(t){e.exports=function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){return i(t[s][1][e]||e)},l,l.exports,e,t,n,r)}return n[s].exports}for(var o=!1,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,n,r){(function(e){"use strict";var t,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,s=new i(c),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),t=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)t="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var u=new e.MessageChannel;u.port1.onmessage=c,t=function(){u.port2.postMessage(0)}}var l=[];function c(){var e,t;r=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}r=!1}n.exports=function(e){1!==l.push(e)||r||t()}}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var r=e(1);function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function l(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&f(this,e)}function c(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(e,t,n){r(function(){var r;try{r=t(n)}catch(t){return o.reject(e,t)}r===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,r)})}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var n=!1;function r(t){n||(n=!0,o.reject(e,t))}function i(t){n||(n=!0,o.resolve(e,t))}var s=p(function(){t(i,r)});"error"===s.status&&r(s.value)}function p(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=l,l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var n=new this.constructor(i);return this.state!==u?h(n,this.state===a?e:t,this.outcome):this.queue.push(new c(n,e,t)),n},c.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){o.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=p(d,t);
1if("error"===n.status)return o.reject(e,n.value);var r=n.value;if(r)f(e,r);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},l.reject=function(e){var t=new this(i);return o.reject(t,e)},l.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var s=new Array(n),a=0,u=-1,l=new this(i);++u<n;)c(e[u],u);return l;function c(e,i){t.resolve(e).then(function(e){s[i]=e,++a!==n||r||(r=!0,o.resolve(l,s))},function(e){r||(r=!0,o.reject(l,e))})}},l.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,n=!1;if(!t)return this.resolve([]);for(var r,s=-1,a=new this(i);++s<t;)r=e[s],this.resolve(r).then(function(e){n||(n=!0,o.resolve(a,e))},function(e){n||(n=!0,o.reject(a,e))});return a}},{1:1}],3:[function(e,n,r){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function o(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var s=Promise;function a(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function u(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function l(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function c(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var h=void 0,d={},f=Object.prototype.toString;function p(e){return"boolean"==typeof h?s.resolve(h):function(e){return new s(function(t){var n=e.transaction("local-forage-detect-blob-support","readwrite"),r=o([""]);n.objectStore("local-forage-detect-blob-support").put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}(e).then(function(e){return h=e})}function m(e){var t=d[e.name],n={};n.promise=new s(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then(function(){return n.promise}):t.dbReady=n.promise}function g(e){var t=d[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function _(e,t){var n=d[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function y(e,t){return new s(function(n,r){if(d[e.name]=d[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);m(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var s=i.open.apply(i,o);t&&(s.onupgradeneeded=function(t){var n=s.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore("local-forage-detect-blob-support")}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),s.onerror=function(e){e.preventDefault(),r(s.error)},s.onsuccess=function(){var t=s.result;t.onversionchange=function(e){e.target.close()},n(t),g(e)}})}function v(e){return y(e,!1)}function b(e){return y(e,!0)}function w(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function I(e){return o([function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}(atob(e.data))],{type:e.type})}function T(e){return e&&e.__local_forage_encoded_blob}function E(e){var t=this,n=t._initReady().then(function(){var e=d[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return u(n,e,e),n}function S(e,t,n,r){void 0===r&&(r=1);try{var i=e.db.transaction(e.storeName,t);n(null,i)}catch(i){if(r>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return s.resolve().then(function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),b(e)}).then(function(){return function(e){m(e);for(var t=d[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,v(e).then(function(t){return e.db=t,w(e)?b(e):t}).then(function(r){e.db=t.db=r;
1for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r}).catch(function(t){throw _(e,t),t})}(e).then(function(){S(e,t,n,r-1)})}).catch(n);n(i)}}var A={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=d[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},d[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=E);var o=[];function a(){return s.resolve()}for(var u=0;u<i.forages.length;u++){var l=i.forages[u];l!==t&&o.push(l._initReady().catch(a))}var c=i.forages.slice(0);return s.all(o).then(function(){return n.db=i.db,v(n)}).then(function(e){return n.db=e,w(n,t._defaultConfig.version)?b(n):e}).then(function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<c.length;r++){var o=c[r];o!==t&&(o._dbInfo.db=n.db,o._dbInfo.version=n.version)}})},_support:function(){try{if(!i||!i.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=new s(function(t,r){n.ready().then(function(){S(n._dbInfo,"readonly",function(i,o){if(i)return r(i);try{var s=o.objectStore(n._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var n=s.result;if(n){var r=n.value;T(r)&&(r=I(r));var i=e(r,n.key,a++);void 0!==i?t(i):n.continue()}else t()},s.onerror=function(){r(s.error)}}catch(e){r(e)}})}).catch(r)});return a(r,t),r},getItem:function(e,t){var n=this;e=l(e);var r=new s(function(t,r){n.ready().then(function(){S(n._dbInfo,"readonly",function(i,o){if(i)return r(i);try{var s=o.objectStore(n._dbInfo.storeName).get(e);s.onsuccess=function(){var e=s.result;void 0===e&&(e=null),T(e)&&(e=I(e)),t(e)},s.onerror=function(){r(s.error)}}catch(e){r(e)}})}).catch(r)});return a(r,t),r},setItem:function(e,t,n){var r=this;e=l(e);var i=new s(function(n,i){var o;r.ready().then(function(){return o=r._dbInfo,"[object Blob]"===f.call(t)?p(o.db).then(function(e){return e?t:(n=t,new s(function(e,t){var r=new FileReader;r.onerror=t,r.onloadend=function(t){var r=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)}));var n}):t}).then(function(t){S(r._dbInfo,"readwrite",function(o,s){if(o)return i(o);try{var a=s.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var u=a.put(t,e);s.oncomplete=function(){void 0===t&&(t=null),n(t)},s.onabort=s.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}})}).catch(i)});return a(i,n),i},removeItem:function(e,t){var n=this;e=l(e);var r=new s(function(t,r){n.ready().then(function(){S(n._dbInfo,"readwrite",function(i,o){if(i)return r(i);try{var s=o.objectStore(n._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){r(s.error)},o.onabort=function(){var e=s.error?s.error:s.transaction.error;r(e)}}catch(e){r(e)}})}).catch(r)});return a(r,t),r},clear:function(e){var t=this,n=new s(function(e,n){t.ready().then(function(){S(t._dbInfo,"readwrite",function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=o.error?o.error:o.transaction.error;n(e)}}catch(e){n(e)}})}).catch(n)});return a(n,e),n},length:function(e){var t=this,n=new s(function(e,n){t.ready().then(function(){S(t._dbInfo,"readonly",function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){n(o.error)}}catch(e){n(e)}})}).catch(n)});return a(n,e),n},key:function(e,t){var n=this,r=new s(function(t,r){e<0?t(null):n.ready().then(function(){S(n._dbInfo,"readonly",function(i,o){if(i)return r(i);try{var s=o.objectStore(n._dbInfo.storeName),a=!1,u=s.openKeyCursor();u.onsuccess=function(){var n=u.result;n?0===e||a?t(n.key):(a=!0,n.advance(e)):t(null)},u.onerror=function(){r(u.error)}}catch(e){r(e)}})}).catch(r)});return a(r,t),r},keys:function(e){var t=this,n=new s(function(e,n){t.ready().then(function(){S(t._dbInfo,"readonly",function(r,i){if(r)return n(r);try{var o=i.objectStore(t._dbInfo.storeName).openKeyCursor(),s=[];o.onsuccess=function(){var t=o.result;t?(s.push(t.key),t.continue()):e(s)},o.onerror=function(){n(o.error)}}catch(e){n(e)}})}).catch(n)});return a(n,e),n},dropInstance:function(e,t){t=c.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r;if(e.name){var o=e.name===n.name&&this._dbInfo.db?s.resolve(this._dbInfo.db):v(e).then(function(t){var n=d[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t});r=e.storeName?o.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.ver
1sion+1;m(e);var r=d[e.name],o=r.forages;t.close();for(var a=0;a<o.length;a++){var u=o[a];u._dbInfo.db=null,u._dbInfo.version=n}return new s(function(t,r){var o=i.open(e.name,n);o.onerror=function(e){o.result.close(),r(e)},o.onupgradeneeded=function(){o.result.deleteObjectStore(e.storeName)},o.onsuccess=function(){var e=o.result;e.close(),t(e)}}).then(function(e){r.db=e;for(var t=0;t<o.length;t++){var n=o[t];n._dbInfo.db=e,g(n._dbInfo)}}).catch(function(t){throw(_(e,t)||s.resolve()).catch(function(){}),t})}}):o.then(function(t){m(e);var n=d[e.name],r=n.forages;t.close();for(var o=0;o<r.length;o++)r[o]._dbInfo.db=null;return new s(function(t,n){var r=i.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}).then(function(e){n.db=e;for(var t=0;t<r.length;t++)g(r[t]._dbInfo)}).catch(function(t){throw(_(e,t)||s.resolve()).catch(function(){}),t})})}else r=s.reject("Invalid arguments");return a(r,t),r}},C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=/^~~local_forage_type~([^~]+)~/,x=Object.prototype.toString;function N(e){var t,n,r,i,o,s=.75*e.length,a=e.length,u=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var l=new ArrayBuffer(s),c=new Uint8Array(l);for(t=0;t<a;t+=4)n=C.indexOf(e[t]),r=C.indexOf(e[t+1]),i=C.indexOf(e[t+2]),o=C.indexOf(e[t+3]),c[u++]=n<<2|r>>4,c[u++]=(15&r)<<4|i>>2,c[u++]=(3&i)<<6|63&o;return l}function D(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=C[n[t]>>2],r+=C[(3&n[t])<<4|n[t+1]>>4],r+=C[(15&n[t+1])<<2|n[t+2]>>6],r+=C[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var O={serialize:function(e,t){var n="";if(e&&(n=x.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===x.call(e.buffer))){var r,i="__lfsc__:";e instanceof ArrayBuffer?(r=e,i+="arbf"):(r=e.buffer,"[object Int8Array]"===n?i+="si08":"[object Uint8Array]"===n?i+="ui08":"[object Uint8ClampedArray]"===n?i+="uic8":"[object Int16Array]"===n?i+="si16":"[object Uint16Array]"===n?i+="ur16":"[object Int32Array]"===n?i+="si32":"[object Uint32Array]"===n?i+="ui32":"[object Float32Array]"===n?i+="fl32":"[object Float64Array]"===n?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+D(r))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var n="~~local_forage_type~"+e.type+"~"+D(this.result);t("__lfsc__:blob"+n)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if("__lfsc__:"!==e.substring(0,9))return JSON.parse(e);var t,n=e.substring(13),r=e.substring(9,13);if("blob"===r&&k.test(n)){var i=n.match(k);t=i[1],n=n.substring(i[0].length)}var s=N(n);switch(r){case"arbf":return s;case"blob":return o([s],{type:t});case"si08":return new Int8Array(s);case"ui08":return new Uint8Array(s);case"uic8":return new Uint8ClampedArray(s);case"si16":return new Int16Array(s);case"ur16":return new Uint16Array(s);case"si32":return new Int32Array(s);case"ui32":return new Uint32Array(s);case"fl32":return new Float32Array(s);case"fl64":return new Float64Array(s);default:throw new Error("Unkown type: "+r)}},stringToBuffer:N,bufferToString:D};function R(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function P(e,t,n,r,i,o){e.executeSql(n,r,i,function(e,s){s.code===s.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,a){a.rows.length?o(e,s):R(e,t,function(){e.executeSql(n,r,i,o)},o)},o):o(e,s)},o)}function L(e,t,n,r){var i=this;e=l(e);var o=new s(function(o,s){i.ready().then(function(){void 0===t&&(t=null);var a=t,u=i._dbInfo;u.serializer.serialize(t,function(t,l){l?s(l):u.db.transaction(function(n){P(n,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],function(){o(a)},function(e,t){s(t)})},function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void o(L.apply(i,[e,a,n,r-1]));s(t)}})})}).catch(s)});return a(o,n),o}var j={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var i=new s(function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(i){R(i,n,function(){t._dbInfo=n,e()},function(e,t){r(t)})},r)});
1return n.serializer=O,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new s(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){P(n,i,"SELECT * FROM "+i.storeName,[],function(n,r){for(var o=r.rows,s=o.length,a=0;a<s;a++){var u=o.item(a),l=u.value;if(l&&(l=i.serializer.deserialize(l)),void 0!==(l=e(l,u.key,a+1)))return void t(l)}t()},function(e,t){r(t)})})}).catch(r)});return a(r,t),r},getItem:function(e,t){var n=this;e=l(e);var r=new s(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){P(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=i.serializer.deserialize(r)),t(r)},function(e,t){r(t)})})}).catch(r)});return a(r,t),r},setItem:function(e,t,n){return L.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=l(e);var r=new s(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){P(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){r(t)})})}).catch(r)});return a(r,t),r},clear:function(e){var t=this,n=new s(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){P(t,r,"DELETE FROM "+r.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)});return a(n,e),n},length:function(e){var t=this,n=new s(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){P(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],function(t,n){var r=n.rows.item(0).c;e(r)},function(e,t){n(t)})})}).catch(n)});return a(n,e),n},key:function(e,t){var n=this,r=new s(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){P(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)},function(e,t){r(t)})})}).catch(r)});return a(r,t),r},keys:function(e){var t=this,n=new s(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){P(t,r,"SELECT key FROM "+r.storeName,[],function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)},function(e,t){n(t)})})}).catch(n)});return a(n,e),n},dropInstance:function(e,t){t=c.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;return a(r=e.name?new s(function(t){var r;r=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(function(e){return new s(function(t,n){e.transaction(function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,r){for(var i=[],o=0;o<r.rows.length;o++)i.push(r.rows.item(o).name);t({db:e,storeNames:i})},function(e,t){n(t)})},function(e){n(e)})})}(r))}).then(function(e){return new s(function(t,n){e.db.transaction(function(r){function i(e){return new s(function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){n(t)})})}for(var o=[],a=0,u=e.storeNames.length;a<u;a++)o.push(i(e.storeNames[a]));s.all(o).then(function(){t()}).catch(function(e){n(e)})},function(e){n(e)})})}):s.reject("Invalid arguments"),t),r}};function q(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}var M={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=q(e,this._defaultConfig),!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(e){return!0}}()||localStorage.length>0?(this._dbInfo=t,t.serializer=O,s.resolve()):s.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then(function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,o=localStorage.length,s=1,a=0;a<o;a++){var u=localStorage.key(a);if(0===u.indexOf(r)){var l=localStorage.getItem(u);if(l&&(l=t.serializer.deserialize(l)),void 0!==(l=e(l,u.substring(i),s++)))return l}}});return a(r,t),r},getItem:function(e,t){var n=this;e=l(e);var r=n.ready().then(function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r});return a(r,t),r},setItem:function(e,t,n){var r=this;e=l(e);var i=r.ready().then(function(){void 0===t&&(t=null);var n=t;return new s(function(i,o){var s=r._dbInfo;s.serializer.serialize(t,function(t,r){if(r)o(r);else try{localStorage.setItem(s.keyPrefix+e,t),i(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||o(e),o(e)}})})});return a(i,n),i},removeItem:function(e,t){var n=this;e=l(e);var r=n.ready().then(function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return a(r,t),r},clear:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}});return a(n,e),n},length:function(e){var t=this.keys().then(function(e){return e.length});return a(t,e),t},key:function(e,t){var n=this,r=n.ready().then(function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t});return a(r,t),r},keys:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var o=localStorage.key(i);0===o.indexOf(e.keyPrefix)&&r.push(o.substring(e.keyPrefix.length))}return r});return a(n,e),n},dropInstance:function(e,t){if(t=c.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,i=this;
1return a(r=e.name?new s(function(t){e.storeName?t(q(e,i._defaultConfig)):t(e.name+"/")}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}}):s.reject("Invalid arguments"),t),r}},F=function(e,t){for(var n,r,i=e.length,o=0;o<i;){if((n=e[o])===(r=t)||"number"==typeof n&&"number"==typeof r&&isNaN(n)&&isNaN(r))return!0;o++}return!1},U=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},z={},V={},B={INDEXEDDB:A,WEBSQL:j,LOCALSTORAGE:M},G=[B.INDEXEDDB._driver,B.WEBSQL._driver,B.LOCALSTORAGE._driver],H=["dropInstance"],K=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(H),$={description:"",driver:G.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function W(e,t){e[t]=function(){var n=arguments;return e.ready().then(function(){return e[t].apply(e,n)})}}function Q(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(U(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var Y=new(function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),B)if(B.hasOwnProperty(n)){var r=B[n],i=r._driver;this[n]=i,z[i]||this.defineDriver(r)}this._defaultConfig=Q({},$),this._config=Q({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new s(function(t,n){try{var r=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(i);for(var o=K.concat("_initStorage"),u=0,l=o.length;u<l;u++){var c=o[u];if((!F(H,c)||e[c])&&"function"!=typeof e[c])return void n(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=s.reject(t);return a(n,arguments[arguments.length-1]),n}},n=0,r=H.length;n<r;n++){var i=H[n];e[i]||(e[i]=t(i))}}();var h=function(n){z[r]&&console.info("Redefining LocalForage driver: "+r),z[r]=e,V[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(h,n):h(!!e._support):h(!0)}catch(e){n(e)}});return u(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=z[e]?s.resolve(z[e]):s.reject(new Error("Driver not found."));return u(r,t,n),r},e.prototype.getSerializer=function(e){var t=s.resolve(O);return u(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return u(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;U(e)||(e=[e]);var i=this._getSupportedDrivers(e);function o(){r._config.driver=r.driver()}function a(e){return r._extend(e),o(),r._ready=r._initStorage(r._config),r._ready}var l=null!==this._driverSet?this._driverSet.catch(function(){return s.resolve()}):s.resolve();return this._driverSet=l.then(function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then(function(e){r._driver=e._driver,o(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(a).catch(n)}o();var u=new Error("No available storage method found.");return r._driverSet=s.reject(u),r._driverSet}()}}(i)})}).catch(function(){o();var e=new Error("No available storage method found.");return r._driverSet=s.reject(e),r._driverSet}
1),u(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!V[e]},e.prototype._extend=function(e){Q(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=K.length;e<t;e++)W(this,K[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=Y},{3:3}]},{},[4])(4)}).call(this,n(10))},34:function(e,t,n){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=u(e),s=r[0],a=r[1],l=new o(function(e,t,n){return 3*(t+n)/4-n}(0,s,a)),c=0,h=a>0?s-4:s;for(n=0;n<h;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===a&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,l[c++]=255&t),1===a&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(l(e,s,s+16383>a?a:s+16383));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},35:function(e,t){t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,l=u>>1,c=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+e[t+h],h+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=l}return(f?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[n+f]=255&s,f+=p,s/=256,l-=8);e[n+f-p]|=128*m}},36:function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},6:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return h});const r=[];var i;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(i||(i={}));const o={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},s=i.INFO,a={[i.DEBUG]:"log",[i.VERBOSE]:"log",[i.INFO]:"info",[i.WARN]:"warn",[i.ERROR]:"error"},u=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=a[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}]  ${e.name}:`,...n)};class l{constructor(e){this.name=e,this._logLevel=s,this._logHandler=u,this._userLogHandler=null,r.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in i))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?o[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,i.DEBUG,...e),this._logHandler(this,i.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,i.VERBOSE,...e),this._logHandler(this,i.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,i.INFO,...e),this._logHandler(this,i.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,i.WARN,...e),this._logHandler(this,i.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,i.ERROR,...e),this._logHandler(this,i.ERROR,...e)}}function c(e){r.forEach(t=>{t.setLogLevel(e)}
1)}function h(e,t){for(const n of r){let r=null;t&&t.level&&(r=o[t.level]),n.userLogHandler=null===e?null:(t,n,...o)=>{const s=o.map(e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(e=>e).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:i[n].toLowerCase(),message:s,args:o,type:t.name})}}}},7:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return s});var r=n(1);class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}class o{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const n=new r.a;if(this.instancesDeferred.set(t,n),this.isInitialized(t)||this.shouldAutoInitialize())try{const e=this.getOrInitializeService({instanceIdentifier:t});e&&n.resolve(e)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:"[DEFAULT]"})}catch(e){}for(const[t,n]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(t);try{const e=this.getOrInitializeService({instanceIdentifier:r});n.resolve(e)}catch(e){}}}}clearInstance(e="[DEFAULT]"){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e="[DEFAULT]"){return this.instances.has(e)}getOptions(e="[DEFAULT]"){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const o=this.instances.get(r);return o&&e(o,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const r of n)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,"[DEFAULT]"===r?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var r;return n||null}normalizeInstanceIdentifier(e="[DEFAULT]"){return this.component?this.component.multipleInstances?e:"[DEFAULT]":e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class s{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new o(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},8:function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return a}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return s}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return u}),n.d(t,"f",function(){return o}
1),n.d(t,"g",function(){return r}),n.d(t,"h",function(){return h}),n.d(t,"i",function(){return c});var r,i,o,s,a,u,l,c,h,d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},f={};(function(){var e,t="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof d&&d];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);!function(e,r){if(r)e:{var i=n;e=e.split(".");for(var o=0;o<e.length-1;o++){var s=e[o];if(!(s in i))break e;i=i[s]}(r=r(o=i[e=e[e.length-1]]))!=o&&null!=r&&t(i,e,{configurable:!0,writable:!0,value:r})}}("Array.prototype.values",function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,function(e,t){return t})}});var p=p||{},m=this||self;function g(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function _(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function y(e,t,n){return e.call.apply(e.bind,arguments)}function v(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function b(e,t,n){return(b=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?y:v).apply(null,arguments)}function w(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function I(e,t){function n(){}n.prototype=t.prototype,e.aa=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Qb=function(e,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return t.prototype[n].apply(e,i)}}function T(e){const t=e.length;if(0<t){const n=Array(t);for(let r=0;r<t;r++)n[r]=e[r];return n}return[]}function E(e,t){for(let t=1;t<arguments.length;t++){const n=arguments[t];if(g(n)){const t=e.length||0,r=n.length||0;e.length=t+r;for(let i=0;i<r;i++)e[t+i]=n[i]}else e.push(n)}}function S(e){return/^[\s\xa0]*$/.test(e)}function A(){var e=m.navigator;return e&&(e=e.userAgent)?e:""}function C(e){return C[" "](e),e}C[" "]=function(){};var k=!(-1==A().indexOf("Gecko")||-1!=A().toLowerCase().indexOf("webkit")&&-1==A().indexOf("Edge")||-1!=A().indexOf("Trident")||-1!=A().indexOf("MSIE")||-1!=A().indexOf("Edge"));function x(e,t,n){for(const r in e)t.call(n,e[r],r,e)}function N(e){const t={};for(const n in e)t[n]=e[n];return t}const D="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function O(e,t){let n,r;for(let t=1;t<arguments.length;t++){for(n in r=arguments[t],r)e[n]=r[n];for(let t=0;t<D.length;t++)n=D[t],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function R(e){var t=1;e=e.split(":");const n=[];for(;0<t&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function P(e){m.setTimeout(()=>{throw e},0)}function L(){var e=U;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var j=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new q,e=>e.reset());class q{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let M,F=!1,U=new class{constructor(){this.h=this.g=null}add(e,t){const n=j.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},z=()=>{const e=m.Promise.resolve(void 0);M=()=>{e.then(V)}};var V=()=>{for(var e;e=L();){try{e.h.call(e.g)}catch(e){P(e)}var t=j;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}F=!1};function B(){this.s=this.s,this.C=this.C}function G(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}B.prototype.s=!1,B.prototype.ma=function(){this.s||(this.s=!0,this.N())},B.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},G.prototype.h=function(){this.defaultPrevented=!0};var H=function(){if(!m.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};m.addEventListener("test",e,t),m.removeEventListener("test",e,t)}catch(e){}return e}();function K(e,t){if(G.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(k){e:{try{C(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}
1else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:$[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&K.aa.h.call(this)}}I(K,G);var $={2:"touch",3:"pen",4:"mouse"};K.prototype.h=function(){K.aa.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var W="closure_listenable_"+(1e6*Math.random()|0),Q=0;function Y(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ha=i,this.key=++Q,this.da=this.fa=!1}function J(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function X(e){this.src=e,this.g={},this.h=0}function Z(e,t){var n=t.type;if(n in e.g){var r,i=e.g[n],o=Array.prototype.indexOf.call(i,t,void 0);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(J(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function ee(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i];if(!o.da&&o.listener==t&&o.capture==!!n&&o.ha==r)return i}return-1}X.prototype.add=function(e,t,n,r,i){var o=e.toString();(e=this.g[o])||(e=this.g[o]=[],this.h++);var s=ee(e,t,r,i);return-1<s?(t=e[s],n||(t.fa=!1)):((t=new Y(t,this.src,o,!!r,i)).fa=n,e.push(t)),t};var te="closure_lm_"+(1e6*Math.random()|0),ne={};function re(e,t,n,r,i){if(r&&r.once)return function e(t,n,r,i,o){if(Array.isArray(n)){for(var s=0;s<n.length;s++)e(t,n[s],r,i,o);return null}return r=ce(r),t&&t[W]?t.L(n,r,_(i)?!!i.capture:!!i,o):ie(t,n,r,!0,i,o)}(e,t,n,r,i);if(Array.isArray(t)){for(var o=0;o<t.length;o++)re(e,t[o],n,r,i);return null}return n=ce(n),e&&e[W]?e.K(t,n,_(r)?!!r.capture:!!r,i):ie(e,t,n,!1,r,i)}function ie(e,t,n,r,i,o){if(!t)throw Error("Invalid event type");var s=_(i)?!!i.capture:!!i,a=ue(e);if(a||(e[te]=a=new X(e)),(n=a.add(t,n,r,s,o)).proxy)return n;if(r=function(){const e=ae;return function t(n){return e.call(t.src,t.listener,n)}}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)H||(i=s),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(se(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function oe(e){if("number"!=typeof e&&e&&!e.da){var t=e.src;if(t&&t[W])Z(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(se(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=ue(t))?(Z(n,e),0==n.h&&(n.src=null,t[te]=null)):J(e)}}}function se(e){return e in ne?ne[e]:ne[e]="on"+e}function ae(e,t){if(e.da)e=!0;else{t=new K(t,this);var n=e.listener,r=e.ha||e.src;e.fa&&oe(e),e=n.call(r,t)}return e}function ue(e){return(e=e[te])instanceof X?e:null}var le="__closure_events_fn_"+(1e9*Math.random()>>>0);function ce(e){return"function"==typeof e?e:(e[le]||(e[le]=function(t){return e.handleEvent(t)}),e[le])}function he(){B.call(this),this.i=new X(this),this.M=this,this.F=null}function de(e,t){var n,r=e.F;if(r)for(n=[];r;r=r.F)n.push(r);if(e=e.M,r=t.type||t,"string"==typeof t)t=new G(t,e);else if(t instanceof G)t.target=t.target||e;else{var i=t;O(t=new G(r,e),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var s=t.g=n[o];i=fe(s,r,!0,t)&&i}if(i=fe(s=t.g=e,r,!0,t)&&i,i=fe(s,r,!1,t)&&i,n)for(o=0;o<n.length;o++)i=fe(s=t.g=n[o],r,!1,t)&&i}function fe(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var i=!0,o=0;o<t.length;++o){var s=t[o];if(s&&!s.da&&s.capture==n){var a=s.listener,u=s.ha||s.src;s.fa&&Z(e.i,s),i=!1!==a.call(u,r)&&i}}return i&&!r.defaultPrevented}function pe(e,t,n){if("function"==typeof e)n&&(e=b(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=b(e.handleEvent,e)}return 2147483647<Number(t)?-1:m.setTimeout(e,t||0)}I(he,B),he.prototype[W]=!0,he.prototype.removeEventListener=function(e,t,n,r){!function e(t,n,r,i,o){if(Array.isArray(n))for(var s=0;s<n.length;s++)e(t,n[s],r,i,o);else i=_(i)?!!i.capture:!!i,r=ce(r),t&&t[W]?(t=t.i,(n=String(n).toString())in t.g&&-1<(r=ee(s=t.g[n],r,i,o))&&(J(s[r]),Array.prototype.splice.call(s,r,1),0==s.length&&(delete t.g[n],t.h--))):t&&(t=ue(t))&&(n=t.g[n.toString()],t=-1,n&&(t=ee(n,r,i,o)),(r=-1<t?n[t]:null)&&oe(r))}(this,e,t,n,r)},he.prototype.N=function(){if(he.aa.N.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)J(n[r]);delete t.g[e],t.h--}}this.F=null},he.prototype.K=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},he.prototype.L=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};class me extends B{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:function e(t){t.g=pe(()=>{t.g=null,t.i&&(t.i=!1,e(t))},t.l);const n=t.h;t.h=null,t.m.apply(null,n)}(this)}N(){super.N(),this.g&&(m.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ge(e){B.call(this),this.h=e,this.g={}}I(ge,B);var _e=[];function ye(e){x(e.g,function(e,t){this.g.hasOwnProperty(t)&&oe(e)},e),e.g={}}ge.prototype.N=function(){ge.aa.N.call(this),ye(this)},ge.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var ve=m.JSON.stringify,be=m.JSON.parse;function we(){}function Ie(e){return e.h||(e.h=e.i())}function Te(){}we.prototype.h=null;var Ee={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Se(){G.call(this,"d")}function Ae(){G.call(this,"c")}I(Se,G),I(Ae,G);var Ce={},ke=null;function xe(){return ke=ke||new he}function Ne(e){G.call(this,Ce.La,e)}function De(e){const t=xe();de(t,new Ne(t))}function Oe(e,t){G.call(this,Ce.STAT_EVENT,e),this.stat=t}function Re(e){const t=xe();de(t,new Oe(t,e))}function Pe(e,t){G.call(this,Ce.Ma,e),this.size=t}function Le(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return m.setTimeout(function(){e()},t)}function je(){this.g=!0}function qe(e,t,n,r){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var s=1;s<i.length;s++)i[s]=""}}}return ve(n)}catch(e){return t}}(e,n)+(r?" "+r:"")})}Ce.La="serverreachability",I(Ne,G),Ce.STAT_EVENT="statevent",I(Oe,G),Ce.Ma="timingevent",I(Pe,G),je.prototype.xa=function(){this.g=!1},je.prototype.info=function(){};var Me,Fe={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},Ue={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"};function ze(){}function Ve(e,t,n,r){this.j=e,this.i=t,this.l=n,this.R=r||1,this.U=new ge(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Be}function Be(){this.i=null,this.g="",this.h=!1}I(ze,we),ze.prototype.g=function(){return new XMLHttpRequest},ze.prototype.i=function(){return{}},Me=new ze;var Ge={},He={};function Ke(e,t,n){e.L=1,e.v=_t(dt(t)),e.m=n,e.P=!0,$e(e,null)}function $e(e,t){e.F=Date.now(),Ye(e),e.A=dt(e.v);var n=e.A,r=e.R;Array.isArray(r)||(r=[String(r)]),Dt(n.i,"t",r),e.C=0,n=e.j.J,e.h=new Be,e.g=vn(e.j,n?t:null,!e.m),
10<e.O&&(e.M=new me(b(e.Y,e,e.g),e.O)),t=e.U,n=e.g,r=e.ca;var i="readystatechange";Array.isArray(i)||(i&&(_e[0]=i.toString()),i=_e);for(var o=0;o<i.length;o++){var s=re(n,i[o],r||t.handleEvent,!1,t.h||t);if(!s)break;t.g[s.key]=s}t=e.H?N(e.H):{},e.m?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.A,e.u,e.m,t)):(e.u="GET",e.g.ea(e.A,e.u,null,t)),De(),function(e,t,n,r,i,o){e.info(function(){if(e.g)if(o)for(var s="",a=o.split("&"),u=0;u<a.length;u++){var l=a[u].split("=");if(1<l.length){var c=l[0];l=l[1];var h=c.split("_");s=2<=h.length&&"type"==h[1]?s+(c+"=")+l+"&":s+(c+"=redacted&")}}else s=null;else s=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+s})}(e.i,e.u,e.A,e.l,e.R,e.m)}function We(e){return!!e.g&&"GET"==e.u&&2!=e.L&&e.j.Ca}function Qe(e,t){var n=e.C,r=t.indexOf("\n",n);return-1==r?He:(n=Number(t.substring(n,r)),isNaN(n)?Ge:(r+=1)+n>t.length?He:(t=t.slice(r,r+n),e.C=r+n,t))}function Ye(e){e.S=Date.now()+e.I,Je(e,e.I)}function Je(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=Le(b(e.ba,e),t)}function Xe(e){e.B&&(m.clearTimeout(e.B),e.B=null)}function Ze(e){0==e.j.G||e.J||pn(e.j,e)}function et(e){Xe(e);var t=e.M;t&&"function"==typeof t.ma&&t.ma(),e.M=null,ye(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.ma())}function tt(e,t){try{var n=e.j;if(0!=n.G&&(n.g==e||ot(n.h,e)))if(!e.K&&ot(n.h,e)&&3==n.G){try{var r=n.Da.g.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.u){if(n.g){if(!(n.g.F+3e3<e.F))break e;fn(n),nn(n)}cn(n),Re(18)}}else n.za=i[1],0<n.za-n.T&&37500>i[2]&&n.F&&0==n.v&&!n.C&&(n.C=Le(b(n.Za,n),6e3));if(1>=it(n.h)&&n.ca){try{n.ca()}catch(e){}n.ca=void 0}}else gn(n,11)}else if((e.K||n.g==e)&&fn(n),!S(t))for(i=n.Da.g.parse(t),t=0;t<i.length;t++){let l=i[t];if(n.T=l[0],l=l[1],2==n.G)if("c"==l[0]){n.K=l[1],n.ia=l[2];const t=l[3];null!=t&&(n.la=t,n.j.info("VER="+n.la));const i=l[4];null!=i&&(n.Aa=i,n.j.info("SVER="+n.Aa));const c=l[5];null!=c&&"number"==typeof c&&0<c&&(r=1.5*c,n.L=r,n.j.info("backChannelRequestTimeoutMs_="+r)),r=n;const h=e.g;if(h){const e=h.g?h.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var o=r.h;o.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(o.j=o.l,o.g=new Set,o.h&&(st(o,o.h),o.h=null))}if(r.D){const e=h.g?h.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(r.ya=e,gt(r.I,r.D,e))}}n.G=3,n.l&&n.l.ua(),n.ba&&(n.R=Date.now()-e.F,n.j.info("Handshake RTT: "+n.R+"ms"));var s=e;if((r=n).qa=yn(r,r.J?r.ia:null,r.W),s.K){at(r.h,s);var a=s,u=r.L;u&&(a.I=u),a.B&&(Xe(a),Ye(a)),r.g=s}else ln(r);0<n.i.length&&on(n)}else"stop"!=l[0]&&"close"!=l[0]||gn(n,7);else 3==n.G&&("stop"==l[0]||"close"==l[0]?"stop"==l[0]?gn(n,7):tn(n):"noop"!=l[0]&&n.l&&n.l.ta(l),n.v=0)}De()}catch(e){}}function nt(e){this.l=e||10,e=m.PerformanceNavigationTiming?0<(e=m.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):!!(m.chrome&&m.chrome.loadTimes&&m.chrome.loadTimes()&&m.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function rt(e){return!!e.h||!!e.g&&e.g.size>=e.j}function it(e){return e.h?1:e.g?e.g.size:0}function ot(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function st(e,t){e.g?e.g.add(t):e.h=t}function at(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function ut(e){if(null!=e.h)return e.i.concat(e.h.D);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.D);return t}return T(e.i)}function lt(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(g(e)||"string"==typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.na&&"function"==typeof e.na)return e.na();if(!e.V||"function"!=typeof e.V){if("undefined"!=typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!=typeof Set&&e instanceof Set)){if(g(e)||"string"==typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}t=[],n=0;for(const r in e)t[n++]=r;return t}}}(e),r=function(e){if(e.V&&"function"==typeof e.V)return e.V();if("undefined"!=typeof Map&&e instanceof Map||"undefined"!=typeof Set&&e instanceof Set)return Array.from(e.values());if("string"==typeof e)return e.split("");
1if(g(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),i=r.length,o=0;o<i;o++)t.call(void 0,r[o],n&&n[o],e)}Ve.prototype.ca=function(e){e=e.target;const t=this.M;t&&3==Jt(e)?t.j():this.Y(e)},Ve.prototype.Y=function(e){try{if(e==this.g)e:{const h=Jt(this.g);var t=this.g.Ba();if(this.g.Z(),!(3>h)&&(3!=h||this.g&&(this.h.h||this.g.oa()||Xt(this.g)))){this.J||4!=h||7==t||De(),Xe(this);var n=this.g.Z();this.X=n;t:if(We(this)){var r=Xt(this.g);e="";var i=r.length,o=4==Jt(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){et(this),Ze(this);var s="";break t}this.h.i=new m.TextDecoder}for(t=0;t<i;t++)this.h.h=!0,e+=this.h.i.decode(r[t],{stream:!(o&&t==i-1)});r.length=0,this.h.g+=e,this.C=0,s=this.h.g}else s=this.g.oa();if(this.o=200==n,function(e,t,n,r,i,o,s){e.info(function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+o+" "+s})}(this.i,this.u,this.A,this.l,this.R,h,n),this.o){if(this.T&&!this.K){t:{if(this.g){var a,u=this.g;if((a=u.g?u.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!S(a)){var l=a;break t}}l=null}if(!(n=l)){this.o=!1,this.s=3,Re(12),et(this),Ze(this);break e}qe(this.i,this.l,n,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,tt(this,n)}if(this.P){let e;for(n=!0;!this.J&&this.C<s.length;){if(e=Qe(this,s),e==He){4==h&&(this.s=4,Re(14),n=!1),qe(this.i,this.l,null,"[Incomplete Response]");break}if(e==Ge){this.s=4,Re(15),qe(this.i,this.l,s,"[Invalid Chunk]"),n=!1;break}qe(this.i,this.l,e,null),tt(this,e)}if(We(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=h||0!=s.length||this.h.h||(this.s=1,Re(16),n=!1),this.o=this.o&&n,n){if(0<s.length&&!this.W){this.W=!0;var c=this.j;c.g==this&&c.ba&&!c.M&&(c.j.info("Great, no buffering proxy detected. Bytes received: "+s.length),hn(c),c.M=!0,Re(11))}}else qe(this.i,this.l,s,"[Invalid Chunked Response]"),et(this),Ze(this)}else qe(this.i,this.l,s,null),tt(this,s);4==h&&et(this),this.o&&!this.J&&(4==h?pn(this.j,this):(this.o=!1,Ye(this)))}else(function(e){const t={};e=(e.g&&2<=Jt(e)&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let r=0;r<e.length;r++){if(S(e[r]))continue;var n=R(e[r]);const i=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const o=t[i]||[];t[i]=o,o.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,function(e){return e.join(", ")})})(this.g),400==n&&0<s.indexOf("Unknown SID")?(this.s=3,Re(12)):(this.s=0,Re(13)),et(this),Ze(this)}}}catch(e){}},Ve.prototype.cancel=function(){this.J=!0,et(this)},Ve.prototype.ba=function(){this.B=null;const e=Date.now();0<=e-this.S?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.A),2!=this.L&&(De(),Re(17)),et(this),this.s=2,Ze(this)):Je(this,this.S-e)},nt.prototype.cancel=function(){if(this.i=ut(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var ct=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function ht(e){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,e instanceof ht){this.h=e.h,ft(this,e.j),this.o=e.o,this.g=e.g,pt(this,e.s),this.l=e.l;var t=e.i,n=new Ct;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),mt(this,n),this.m=e.m}else e&&(t=String(e).match(ct))?(this.h=!1,ft(this,t[1]||"",!0),this.o=yt(t[2]||""),this.g=yt(t[3]||"",!0),pt(this,t[4]),this.l=yt(t[5]||"",!0),mt(this,t[6]||"",!0),this.m=yt(t[7]||"")):(this.h=!1,this.i=new Ct(null,this.h))}function dt(e){return new ht(e)}function ft(e,t,n){e.j=n?yt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function pt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.s=t}else e.s=null}function mt(e,t,n){t instanceof Ct?(e.i=t,function(e,t){t&&!e.j&&(kt(e),e.i=null,e.g.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(xt(this,t),Dt(this,n,e))},e)),e.j=t}(e.i,e.h)):(n||(t=vt(t,St)),e.i=new Ct(t,e.h))}function gt(e,t,n){e.i.set(t,n)}function _t(e){return gt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function yt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function vt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,bt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function bt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}ht.prototype.toString=function(){var e=[],t=this.j;t&&e.push(vt(t,It,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(vt(t,It,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.s)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(vt(n,"/"==n.charAt(0)?Et:Tt,!0))
1),(n=this.i.toString())&&e.push("?",n),(n=this.m)&&e.push("#",vt(n,At)),e.join("")};var wt,It=/[#\/\?@]/g,Tt=/[#\?:]/g,Et=/[#\?]/g,St=/[#\?@]/g,At=/#/g;function Ct(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function kt(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var o=e[n].substring(0,r);i=e[n].substring(r+1)}else o=e[n];t(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function xt(e,t){kt(e),t=Ot(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function Nt(e,t){return kt(e),t=Ot(e,t),e.g.has(t)}function Dt(e,t,n){xt(e,t),0<n.length&&(e.i=null,e.g.set(Ot(e,t),T(n)),e.h+=n.length)}function Ot(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function Rt(e,t,n,r,i){try{i&&(i.onload=null,i.onerror=null,i.onabort=null,i.ontimeout=null),r(n)}catch(e){}}function Pt(){this.g=new class{stringify(e){return m.JSON.stringify(e,void 0)}parse(e){return m.JSON.parse(e,void 0)}}}function Lt(e,t,n){const r=n||"";try{lt(e,function(e,n){let i=e;_(e)&&(i=ve(e)),t.push(r+n+"="+encodeURIComponent(i))})}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function jt(e){this.l=e.Ub||null,this.j=e.eb||!1}function qt(e,t){he.call(this),this.D=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}function Mt(e){e.j.read().then(e.Pa.bind(e)).catch(e.ga.bind(e))}function Ft(e){e.readyState=4,e.l=null,e.j=null,e.v=null,Ut(e)}function Ut(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function zt(e){let t="";return x(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function Vt(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=zt(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):gt(e,t,n))}function Bt(e){he.call(this),this.headers=new Map,this.o=e||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}(e=Ct.prototype).add=function(e,t){kt(this),this.i=null,e=Ot(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},e.forEach=function(e,t){kt(this),this.g.forEach(function(n,r){n.forEach(function(n){e.call(t,n,r,this)},this)},this)},e.na=function(){kt(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r<t.length;r++){const i=e[r];for(let e=0;e<i.length;e++)n.push(t[r])}return n},e.V=function(e){kt(this);let t=[];if("string"==typeof e)Nt(this,e)&&(t=t.concat(this.g.get(Ot(this,e))));else{e=Array.from(this.g.values());for(let n=0;n<e.length;n++)t=t.concat(e[n])}return t},e.set=function(e,t){return kt(this),this.i=null,Nt(this,e=Ot(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},e.get=function(e,t){return e&&0<(e=this.V(e)).length?String(e[0]):t},e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(var n=0;n<t.length;n++){var r=t[n];const o=encodeURIComponent(String(r)),s=this.V(r);for(r=0;r<s.length;r++){var i=o;""!==s[r]&&(i+="="+encodeURIComponent(String(s[r]))),e.push(i)}}return this.i=e.join("&")},I(jt,we),jt.prototype.g=function(){return new qt(this.l,this.j)},jt.prototype.i=(wt={},function(){return wt}),I(qt,he),(e=qt.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.B=e,this.A=t,this.readyState=1,Ut(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.u,method:this.B,credentials:this.m,cache:void 0};e&&(t.body=e),(this.D||m).fetch(new Request(this.A,t)).then(this.Sa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Ft(this)),this.readyState=0},e.Sa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,Ut(this)),this.g&&(this.readyState=3,Ut(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(void 0!==m.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Mt(this)}else e.text().then(this.Ra.bind(this),this.ga.bind(this))},e.Pa=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.v.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?Ft(this):Ut(this),3==this.readyState&&Mt(this)}},e.Ra=function(e){this.g&&(this.response=this.responseText=e,Ft(this))},e.Qa=function(e){this.g&&(this.response=e,Ft(this))},e.ga=function(){this.g&&Ft(this)},e.setRequestHeader=function(e,t){this.u.append(e,t)},e.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(qt.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),I(Bt,he);var Gt=/^https?$/i,Ht=["POST","PUT"];function Kt(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.m=5,$t(e),Qt(e)}function $t(e){e.A||(e.A=!0,de(e,"complete"),de(e,"error"))}function Wt(e){if(e.h&&void 0!==p&&(!e.v[1]||4!=Jt(e)||2!=e.Z()))if(e.u&&4==Jt(e))pe(e.Ea,0,e);else if(de(e,"readystatechange"),4==Jt(e)){e.h=!1;try{const s=e.Z();e:switch(s){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var r;if(r=0===s){var i=String(e.D).match(ct)[1]||null;!i&&m.self&&m.self.location&&(i=m.self.location.protocol.slice(0,-1)),r=!Gt.test(i?i.toLowerCase():"")}n=r}if(n)de(e,"complete"),de(e,"success");else{e.m=6;try{var o=2<Jt(e)?e.g.statusText:""}catch(e){o=""}e.l=o+" ["+e.Z()+"]",$t(e)}}finally{Qt(e)}}}function Qt(e,t){if(e.g){Yt(e);const n=e.g,r=e.v[0]?()=>{}:null;e.g=null,e.v=null,t||de(e,"ready");try{n.onreadystatechange=r}catch(e){}}}function Yt(e){e.I&&(m.clearTimeout(e.I),e.I=null)}function Jt(e){return e.g?e.g.readyState:0}function Xt(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.H){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}
1function Zt(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function en(e){this.Aa=0,this.i=[],this.j=new je,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Zt("failFast",!1,e),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Zt("baseRetryDelayMs",5e3,e),this.cb=Zt("retryDelaySeedMs",1e4,e),this.Wa=Zt("forwardChannelMaxRetries",2,e),this.wa=Zt("forwardChannelRequestTimeoutMs",2e4,e),this.pa=e&&e.xmlHttpFactory||void 0,this.Xa=e&&e.Tb||void 0,this.Ca=e&&e.useFetchStreams||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.h=new nt(e&&e.concurrentRequestLimit),this.Da=new Pt,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=e&&e.Rb||!1,e&&e.xa&&this.j.xa(),e&&e.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&e&&e.detectBufferingProxy||!1,this.ja=void 0,e&&e.longPollingTimeout&&0<e.longPollingTimeout&&(this.ja=e.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}function tn(e){if(rn(e),3==e.G){var t=e.U++,n=dt(e.I);if(gt(n,"SID",e.K),gt(n,"RID",t),gt(n,"TYPE","terminate"),an(e,n),(t=new Ve(e,e.j,t)).L=2,t.v=_t(dt(n)),n=!1,m.navigator&&m.navigator.sendBeacon)try{n=m.navigator.sendBeacon(t.v.toString(),"")}catch(e){}!n&&m.Image&&((new Image).src=t.v,n=!0),n||(t.g=vn(t.j,null),t.g.ea(t.v)),t.F=Date.now(),Ye(t)}_n(e)}function nn(e){e.g&&(hn(e),e.g.cancel(),e.g=null)}function rn(e){nn(e),e.u&&(m.clearTimeout(e.u),e.u=null),fn(e),e.h.cancel(),e.s&&("number"==typeof e.s&&m.clearTimeout(e.s),e.s=null)}function on(e){if(!rt(e.h)&&!e.s){e.s=!0;var t=e.Ga;M||z(),F||(M(),F=!0),U.add(t,e),e.B=0}}function sn(e,t){var n;n=t?t.l:e.U++;const r=dt(e.I);gt(r,"SID",e.K),gt(r,"RID",n),gt(r,"AID",e.T),an(e,r),e.m&&e.o&&Vt(r,e.m,e.o),n=new Ve(e,e.j,n,e.B+1),null===e.m&&(n.H=e.o),t&&(e.i=t.D.concat(e.i)),t=un(e,n,1e3),n.I=Math.round(.5*e.wa)+Math.round(.5*e.wa*Math.random()),st(e.h,n),Ke(n,r,t)}function an(e,t){e.H&&x(e.H,function(e,n){gt(t,n,e)}),e.l&&lt({},function(e,n){gt(t,n,e)})}function un(e,t,n){n=Math.min(e.i.length,n);var r=e.l?b(e.l.Na,e.l,e):null;e:{var i=e.i;let t=-1;for(;;){const o=["count="+n];-1==t?0<n?(t=i[0].g,o.push("ofs="+t)):t=0:o.push("ofs="+t);let s=!0;for(let a=0;a<n;a++){let n=i[a].g;const u=i[a].map;if(n-=t,0>n)t=Math.max(0,i[a].g-100),s=!1;else try{Lt(u,o,"req"+n+"_")}catch(e){r&&r(u)}}if(s){r=o.join("&");break e}}}return e=e.i.splice(0,n),t.D=e,r}function ln(e){if(!e.g&&!e.u){e.Y=1;var t=e.Fa;M||z(),F||(M(),F=!0),U.add(t,e),e.v=0}}function cn(e){return!(e.g||e.u||3<=e.v||(e.Y++,e.u=Le(b(e.Fa,e),mn(e,e.v)),e.v++,0))}function hn(e){null!=e.A&&(m.clearTimeout(e.A),e.A=null)}function dn(e){e.g=new Ve(e,e.j,"rpc",e.Y),null===e.m&&(e.g.H=e.o),e.g.O=0;var t=dt(e.qa);gt(t,"RID","rpc"),gt(t,"SID",e.K),gt(t,"AID",e.T),gt(t,"CI",e.F?"0":"1"),!e.F&&e.ja&&gt(t,"TO",e.ja),gt(t,"TYPE","xmlhttp"),an(e,t),e.m&&e.o&&Vt(t,e.m,e.o),e.L&&(e.g.I=e.L);var n=e.g;e=e.ia,n.L=1,n.v=_t(dt(t)),n.m=null,n.P=!0,$e(n,e)}function fn(e){null!=e.C&&(m.clearTimeout(e.C),e.C=null)}function pn(e,t){var n=null;if(e.g==t){fn(e),hn(e),e.g=null;var r=2}else{if(!ot(e.h,t))return;n=t.D,at(e.h,t),r=1}if(0!=e.G)if(t.o)if(1==r){n=t.m?t.m.length:0,t=Date.now()-t.F;var i=e.B;de(r=xe(),new Pe(r,n)),on(e)}else ln(e);else if(3==(i=t.s)||0==i&&0<t.X||!(1==r&&function(e,t){return!(it(e.h)>=e.h.j-(e.s?1:0)||(e.s?(e.i=t.D.concat(e.i),0):1==e.G||2==e.G||e.B>=(e.Va?0:e.Wa)||(e.s=Le(b(e.Ga,e,t),mn(e,e.B)),e.B++,0)))}(e,t)||2==r&&cn(e)))switch(n&&0<n.length&&(t=e.h,t.i=t.i.concat(n)),i){case 1:gn(e,5);break;case 4:gn(e,10);break;case 3:gn(e,6);break;default:gn(e,2)}}function mn(e,t){let n=e.Ta+Math.floor(Math.random()*e.cb);return e.isActive()||(n*=2),n*t}function gn(e,t){if(e.j.info("Error code "+t),2==t){var n=b(e.fb,e),r=e.Xa;const t=!r;r=new ht(r||"//www.google.com/images/cleardot.gif"),m.location&&"http"==m.location.protocol||ft(r,"https"),_t(r),t?function(e,t){const n=new je;if(m.Image){const r=new Image;r.onload=w(Rt,n,"TestLoadImage: loaded",!0,t,r),r.onerror=w(Rt,n,"TestLoadImage: error",!1,t,r),r.onabort=w(Rt,n,"TestLoadImage: abort",!1,t,r),r.ontimeout=w(Rt,n,"TestLoadImage: timeout",!1,t,r),m.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=e}else t(!1)}(r.toString(),n):function(e,t){new je;const n=new AbortController,r=setTimeout(()=>{n.abort(),Rt(0,0,!1,t)},1e4);fetch(e,{signal:n.signal}).then(e=>{clearTimeout(r),e.ok?Rt(0,0,!0,t):Rt(0,0,!1,t)}).catch(()=>{clearTimeout(r),Rt(0,0,!1,t)})}(r.toString(),n)}else Re(2);e.G=0,e.l&&e.l.sa(t),_n(e),rn(e)}function _n(e){if(e.G=0,e.ka=[],e.l){const t=ut(e.h);
10==t.length&&0==e.i.length||(E(e.ka,t),E(e.ka,e.i),e.h.i.length=0,T(e.i),e.i.length=0),e.l.ra()}}function yn(e,t,n){var r=n instanceof ht?dt(n):new ht(n);if(""!=r.g)t&&(r.g=t+"."+r.g),pt(r,r.s);else{var i=m.location;r=i.protocol,t=t?t+"."+i.hostname:i.hostname,i=+i.port;var o=new ht(null);r&&ft(o,r),t&&(o.g=t),i&&pt(o,i),n&&(o.l=n),r=o}return n=e.D,t=e.ya,n&&t&&gt(r,n,t),gt(r,"VER",e.la),an(e,r),r}function vn(e,t,n){if(t&&!e.J)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Ca&&!e.pa?new Bt(new jt({eb:n})):new Bt(e.pa)).Ha(e.J),t}function bn(){}function wn(){}function In(e,t){he.call(this),this.g=new en(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.va&&(e?e["X-WebChannel-Client-Profile"]=t.va:e={"X-WebChannel-Client-Profile":t.va}),this.g.S=e,(e=t&&t.Sb)&&!S(e)&&(this.g.m=e),this.v=t&&t.supportsCrossDomainXhr||!1,this.u=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!S(t)&&(this.g.D=t,null!==(e=this.h)&&t in e&&t in(e=this.h)&&delete e[t]),this.j=new Sn(this)}function Tn(e){Se.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function En(){Ae.call(this),this.status=1}function Sn(e){this.g=e}(e=Bt.prototype).Ha=function(e){this.J=e},e.ea=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);t=t?t.toUpperCase():"GET",this.D=e,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():Me.g(),this.v=this.o?Ie(this.o):Ie(Me),this.g.onreadystatechange=b(this.Ea,this);try{this.B=!0,this.g.open(t,String(e),!0),this.B=!1}catch(e){return void Kt(this,e)}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var i in r)n.set(i,r[i]);else{if("function"!=typeof r.keys||"function"!=typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));for(const e of r.keys())n.set(e,r.get(e))}r=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),i=m.FormData&&e instanceof m.FormData,!(0<=Array.prototype.indexOf.call(Ht,t,void 0))||r||i||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[e,t]of n)this.g.setRequestHeader(e,t);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Yt(this),this.u=!0,this.g.send(e),this.u=!1}catch(e){Kt(this,e)}},e.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=e||7,de(this,"complete"),de(this,"abort"),Qt(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Qt(this,!0)),Bt.aa.N.call(this)},e.Ea=function(){this.s||(this.B||this.u||this.j?Wt(this):this.bb())},e.bb=function(){Wt(this)},e.isActive=function(){return!!this.g},e.Z=function(){try{return 2<Jt(this)?this.g.status:-1}catch(e){return-1}},e.oa=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},e.Oa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),be(t)}},e.Ba=function(){return this.m},e.Ka=function(){return"string"==typeof this.l?this.l:String(this.l)},(e=en.prototype).la=8,e.G=1,e.connect=function(e,t,n,r){Re(0),this.W=e,this.H=t||{},n&&void 0!==r&&(this.H.OSID=n,this.H.OAID=r),this.F=this.X,this.I=yn(this,null,this.W),on(this)},e.Ga=function(e){if(this.s)if(this.s=null,1==this.G){if(!e){this.U=Math.floor(1e5*Math.random()),e=this.U++;const i=new Ve(this,this.j,e);let o=this.o;if(this.S&&(o?(o=N(o),O(o,this.S)):o=this.S),null!==this.m||this.O||(i.H=o,o=null),this.P)e:{for(var t=0,n=0;n<this.i.length;n++){var r=this.i[n];if(void 0===(r="__data__"in r.map&&"string"==typeof(r=r.map.__data__)?r.length:void 0))break;if(4096<(t+=r)){t=n;break e}if(4096===t||n===this.i.length-1){t=n+1;break e}}t=1e3}else t=1e3;
1t=un(this,i,t),gt(n=dt(this.I),"RID",e),gt(n,"CVER",22),this.D&&gt(n,"X-HTTP-Session-Id",this.D),an(this,n),o&&(this.O?t="headers="+encodeURIComponent(String(zt(o)))+"&"+t:this.m&&Vt(n,this.m,o)),st(this.h,i),this.Ua&&gt(n,"TYPE","init"),this.P?(gt(n,"$req",t),gt(n,"SID","null"),i.T=!0,Ke(i,n,null)):Ke(i,n,t),this.G=2}}else 3==this.G&&(e?sn(this,e):0==this.i.length||rt(this.h)||sn(this))},e.Fa=function(){if(this.u=null,dn(this),this.ba&&!(this.M||null==this.g||0>=this.R)){var e=2*this.R;this.j.info("BP detection timer enabled: "+e),this.A=Le(b(this.ab,this),e)}},e.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Re(10),nn(this),dn(this))},e.Za=function(){null!=this.C&&(this.C=null,nn(this),cn(this),Re(19))},e.fb=function(e){e?(this.j.info("Successfully pinged google.com"),Re(2)):(this.j.info("Failed to ping google.com"),Re(1))},e.isActive=function(){return!!this.l&&this.l.isActive(this)},(e=bn.prototype).ua=function(){},e.ta=function(){},e.sa=function(){},e.ra=function(){},e.isActive=function(){return!0},e.Na=function(){},wn.prototype.g=function(e,t){return new In(e,t)},I(In,he),In.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},In.prototype.close=function(){tn(this.g)},In.prototype.o=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.u&&((n={}).__data__=ve(e),e=n);t.i.push(new class{constructor(e,t){this.g=e,this.map=t}}(t.Ya++,e)),3==t.G&&on(t)},In.prototype.N=function(){this.g.l=null,delete this.j,tn(this.g),delete this.g,In.aa.N.call(this)},I(Tn,Se),I(En,Ae),I(Sn,bn),Sn.prototype.ua=function(){de(this.g,"a")},Sn.prototype.ta=function(e){de(this.g,new Tn(e))},Sn.prototype.sa=function(e){de(this.g,new En)},Sn.prototype.ra=function(){de(this.g,"b")},wn.prototype.createWebChannel=wn.prototype.g,In.prototype.send=In.prototype.o,In.prototype.open=In.prototype.m,In.prototype.close=In.prototype.close,h=f.createWebChannelTransport=function(){return new wn},c=f.getStatEventTarget=function(){return xe()},l=f.Event=Ce,u=f.Stat={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Fe.NO_ERROR=0,Fe.TIMEOUT=8,Fe.HTTP_ERROR=6,a=f.ErrorCode=Fe,Ue.COMPLETE="complete",s=f.EventType=Ue,Te.EventType=Ee,Ee.OPEN="a",Ee.CLOSE="b",Ee.ERROR="c",Ee.MESSAGE="d",he.prototype.listen=he.prototype.K,o=f.WebChannel=Te,i=f.FetchXmlHttpFactory=jt,Bt.prototype.listenOnce=Bt.prototype.L,Bt.prototype.getLastError=Bt.prototype.Ka,Bt.prototype.getLastErrorCode=Bt.prototype.Ba,Bt.prototype.getStatus=Bt.prototype.Z,Bt.prototype.getResponseJson=Bt.prototype.Oa,Bt.prototype.getResponseText=Bt.prototype.oa,Bt.prototype.send=Bt.prototype.ea,Bt.prototype.setWithCredentials=Bt.prototype.Ha,r=f.XhrIo=Bt}).apply(void 0!==d?d:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}).call(this,n(10))},9:function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r,i,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},s={};(function(){var e;function t(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}function n(e,t,n){n||(n=0);var r=Array(16);if("string"==typeof t)for(var i=0;16>i;++i)r[i]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(i=0;16>i;++i)r[i]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],i=e.g[2];var o=e.g[3],s=t+(o^n&(i^o))+r[0]+3614090360&4294967295;s=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=(n=(i=(o=(t=n+(s<<7&4294967295|s>>>25))+((s=o+(i^t&(n^i))+r[1]+3905402710&4294967295)<<12&4294967295|s>>>20))+((s=i+(n^o&(t^n))+r[2]+606105819&4294967295)<<17&4294967295|s>>>15))+((s=n+(t^i&(o^t))+r[3]+3250441966&4294967295)<<22&4294967295|s>>>10))+((s=t+(o^n&(i^o))+r[4]+4118548399&4294967295)<<7&4294967295|s>>>25))+((s=o+(i^t&(n^i))+r[5]+1200080426&4294967295)<<12&4294967295|s>>>20))+((s=i+(n^o&(t^n))+r[6]+2821735955&4294967295)<<17&4294967295|s>>>15))+((s=n+(t^i&(o^t))+r[7]+4249261313&4294967295)<<22&4294967295|s>>>10))+((s=t+(o^n&(i^o))+r[8]+1770035416&4294967295)<<7&4294967295|s>>>25))+((s=o+(i^t&(n^i))+r[9]+2336552879&4294967295)<<12&4294967295|s>>>20))+((s=i+(n^o&(t^n))+r[10]+4294925233&4294967295)<<17&4294967295|s>>>15))+((s=n+(t^i&(o^t))+r[11]+2304563134&4294967295)<<22&4294967295|s>>>10))+((s=t+(o^n&(i^o))+r[12]+1804603682&4294967295)<<7&4294967295|s>>>25))+((s=o+(i^t&(n^i))+r[13]+4254626195&4294967295)<<12&4294967295|s>>>20))+((s=i+(n^o&(t^n))+r[14]+2792965006&4294967295)<<17&4294967295|s>>>15))+((s=n+(t^i&(o^t))+r[15]+1236535329&4294967295)<<22&4294967295|s>>>10))+((s=t+(i^o&(n^i))+r[1]+4129170786&4294967295)<<5&4294967295|s>>>27))+((s=o+(n^i&(t^n))+r[6]+3225465664&4294967295)<<9&4294967295|s>>>23))+((s=i+(t^n&(o^t))+r[11]+643717713&4294967295)<<14&4294967295|s>>>18))+((s=n+(o^t&(i^o))+r[0]+3921069994&4294967295)<<20&4294967295|s>>>12))+((s=t+(i^o&(n^i))+r[5]+3593408605&4294967295)<<5&4294967295|s>>>27))+((s=o+(n^i&(t^n))+r[10]+38016083&4294967295)<<9&4294967295|s>>>23))+((s=i+(t^n&(o^t))+r[15]+3634488961&4294967295)<<14&4294967295|s>>>18))+((s=n+(o^t&(i^o))+r[4]+3889429448&4294967295)<<20&4294967295|s>>>12))+((s=t+(i^o&(n^i))+r[9]+568446438&4294967295)<<5&4294967295|s>>>27))+((s=o+(n^i&(t^n))+r[14]+3275163606&4294967295)<<9&4294967295|s>>>23))+((s=i+(t^n&(o^t))+r[3]+4107603335&4294967295)<<14&4294967295|s>>>18))+((s=n+(o^t&(i^o))+r[8]+1163531501&4294967295)<<20&4294967295|s>>>12))+((s=t+(i^o&(n^i))+r[13]+2850285829&4294967295)<<5&4294967295|s>>>27))+((s=o+(n^i&(t^n))+r[2]+4243563512&4294967295)<<9&4294967295|s>>>23))+((s=i+(t^n&(o^t))+r[7]+1735328473&4294967295)<<14&4294967295|s>>>18))+((s=n+(o^t&(i^o))+r[12]+2368359562&4294967295)<<20&4294967295|s>>>12))+((s=t+(n^i^o)+r[5]+4294588738&4294967295)<<4&4294967295|s>>>28))+((s=o+(t^n^i)+r[8]+2272392833&4294967295)<<11&4294967295|s>>>21))+((s=i+(o^t^n)+r[11]+1839030562&4294967295)<<16&4294967295|s>>>16))+((s=n+(i^o^t)+r[14]+4259657740&4294967295)<<23&4294967295|s>>>9))+((s=t+(n^i^o)+r[1]+2763975236&4294967295)<<4&4294967295|s>>>28))+((s=o+(t^n^i)+r[4]+1272893353&4294967295)<<11&4294967295|s>>>21))+((s=i+(o^t^n)+r[7]+4139469664&4294967295)<<16&4294967295|s>>>16))+((s=n+(i^o^t)+r[10]+3200236656&4294967295)<<23&4294967295|s>>>9))+((s=t+(n^i^o)+r[13]+681279174&4294967295)<<4&4294967295|s>>>28))+((s=o+(t^n^i)+r[0]+3936430074&4294967295)<<11&4294967295|s>>>21))+((s=i+(o^t^n)+r[3]+3572445317&4294967295)<<16&4294967295|s>>>16))+((s=n+(i^o^t)+r[6]+76029189&4294967295)<<23&4294967295|s>>>9))+((s=t+(n^i^o)+r[9]+3654602809&4294967295)<<4&4294967295|s>>>28))+((s=o+(t^n^i)+r[12]+3873151461&4294967295)<<11&4294967295|s>>>21))+((s=i+(o^t^n)+r[15]+530742520&4294967295)<<16&4294967295|s>>>16))+((s=n+(i^o^t)+r[2]+3299628645&4294967295)<<23&4294967295|s>>>9))+((s=t+(i^(n|~o))+r[0]+4096336452&4294967295)<<6&4294967295|s>>>26))+((s=o+(n^(t|~i))+r[7]+1126891415&4294967295)<<10&4294967295|s>>>22))+((s=i+(t^(o|~n))+r[14]+2878612391&4294967295)<<15&4294967295|s>>>17))+((s=n+(o^(i|~t))+r[5]+4237533241&4294967295)<<21&4294967295|s>>>11))+((s=t+(i^(n|~o))+r[12]+1700485571&4294967295)<<6&4294967295|s>>>26))+((s=o+(n^(t|~i))+r[3]+2399980690&4294967295)<<10&4294967295|s>>>22))+((s=i+(t^(o|~n))+r[10]+4293915773&4294967295)<<15&4294967295|s>>>17))+((s=n+(o^(i|~t))+r[1]+2240044497&4294967295)<<21&4294967295|s>>>11))+((s=t+(i^(n|~o))+r[8]+1873313359&4294967295)<<6&4294967295|s>>>26))+((s=o+(n^(t|~i))+r[15]+4264355552&4294967295)<<10&4294967295|s>>>22))+((s=i+(t^(o|~n))+r[6]+2734768916&4294967295)<<15&4294967295|s>>>17))+((s=n+(o^(i|~t))+r[13]+1309151649&4294967295)<<21&4294967295|s>>>11))+((o=(t=n+((s=t+(i^(n|~o))+r[4]+4149444226&4294967295)<<6&4294967295|s>>>
126))+((s=o+(n^(t|~i))+r[11]+3174756917&4294967295)<<10&4294967295|s>>>22))^((i=o+((s=i+(t^(o|~n))+r[2]+718787259&4294967295)<<15&4294967295|s>>>17))|~t))+r[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(i+(s<<21&4294967295|s>>>11))&4294967295,e.g[2]=e.g[2]+i&4294967295,e.g[3]=e.g[3]+o&4294967295}function o(e,t){this.h=t;for(var n=[],r=!0,i=e.length-1;0<=i;i--){var o=0|e[i];r&&o==t||(n[i]=o,r=!1)}this.g=n}!function(e,t){function n(){}n.prototype=t.prototype,e.D=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.C=function(e,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return t.prototype[n].apply(e,i)}}(t,function(){this.blockSize=-1}),t.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.u=function(e,t){void 0===t&&(t=e.length);for(var r=t-this.blockSize,i=this.B,o=this.h,s=0;s<t;){if(0==o)for(;s<=r;)n(this,e,s),s+=this.blockSize;if("string"==typeof e){for(;s<t;)if(i[o++]=e.charCodeAt(s++),o==this.blockSize){n(this,i),o=0;break}}else for(;s<t;)if(i[o++]=e[s++],o==this.blockSize){n(this,i),o=0;break}}this.h=o,this.o+=t},t.prototype.v=function(){var e=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;var n=8*this.o;for(t=e.length-8;t<e.length;++t)e[t]=255&n,n/=256;for(this.u(e),e=Array(16),t=n=0;4>t;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};var a={};function u(e){return-128<=e&&128>e?function(e){var t=a;return Object.prototype.hasOwnProperty.call(t,e)?t[e]:t[e]=function(e){return new o([0|e],0>e?-1:0)}(e)}(e):new o([0|e],0>e?-1:0)}function l(e){if(isNaN(e)||!isFinite(e))return c;if(0>e)return m(l(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=4294967296;return new o(t,0)}var c=u(0),h=u(1),d=u(16777216);function f(e){if(0!=e.h)return!1;for(var t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function p(e){return-1==e.h}function m(e){for(var t=e.g.length,n=[],r=0;r<t;r++)n[r]=~e.g[r];return new o(n,~e.h).add(h)}function g(e,t){return e.add(m(t))}function _(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function y(e,t){this.g=e,this.h=t}function v(e,t){if(f(t))throw Error("division by zero");if(f(e))return new y(c,c);if(p(e))return t=v(m(e),t),new y(m(t.g),m(t.h));if(p(t))return t=v(e,m(t)),new y(m(t.g),t.h);if(30<e.g.length){if(p(e)||p(t))throw Error("slowDivide_ only works with positive integers.");for(var n=h,r=t;0>=r.l(e);)n=b(n),r=b(r);var i=w(n,1),o=w(r,1);for(r=w(r,2),n=w(n,2);!f(r);){var s=o.add(r);0>=s.l(e)&&(i=i.add(n),o=s),r=w(r,1),n=w(n,1)}return t=g(e,i.j(t)),new y(i,t)}for(i=c;0<=e.l(t);){for(n=Math.max(1,Math.floor(e.m()/t.m())),r=48>=(r=Math.ceil(Math.log(n)/Math.LN2))?1:Math.pow(2,r-48),s=(o=l(n)).j(t);p(s)||0<s.l(e);)s=(o=l(n-=r)).j(t);f(o)&&(o=h),i=i.add(o),e=g(e,s)}return new y(i,e)}function b(e){for(var t=e.g.length+1,n=[],r=0;r<t;r++)n[r]=e.i(r)<<1|e.i(r-1)>>>31;return new o(n,e.h)}function w(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,i=[],s=0;s<r;s++)i[s]=0<t?e.i(s+n)>>>t|e.i(s+n+1)<<32-t:e.i(s+n);return new o(i,e.h)}(e=o.prototype).m=function(){if(p(this))return-m(this).m();for(var e=0,t=1,n=0;n<this.g.length;n++){var r=this.i(n);e+=(0<=r?r:4294967296+r)*t,t*=4294967296}return e},e.toString=function(e){if(2>(e=e||10)||36<e)throw Error("radix out of range: "+e);if(f(this))return"0";if(p(this))return"-"+m(this).toString(e);for(var t=l(Math.pow(e,6)),n=this,r="";;){var i=v(n,t).g,o=((0<(n=g(n,i.j(t))).g.length?n.g[0]:n.h)>>>0).toString(e);if(f(n=i))return o+r;for(;6>o.length;)o="0"+o;r=o+r}},e.i=function(e){return 0>e?0:e<this.g.length?this.g[e]:this.h},e.l=function(e){return p(e=g(this,e))?-1:f(e)?0:1},e.abs=function(){return p(this)?m(this):this},e.add=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0,i=0;i<=t;i++){var s=r+(65535&this.i(i))+(65535&e.i(i)),a=(s>>>16)+(this.i(i)>>>16)+(e.i(i)>>>16);r=a>>>16,s&=65535,a&=65535,n[i]=a<<16|s}return new o(n,-2147483648&n[n.length-1]?-1:0)},e.j=function(e){if(f(this)||f(e))return c;if(p(this))return p(e)?m(this).j(m(e)):m(m(this).j(e));if(p(e))return m(this.j(m(e)));if(0>this.l(d)&&0>e.l(d))return l(this.m()*e.m());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(var i=0;i<e.g.length;i++){var s=this.i(r)>>>16,a=65535&this.i(r),u=e.i(i)>>>16,h=65535&e.i(i);n[2*r+2*i]+=a*h,_(n,2*r+2*i),n[2*r+2*i+1]+=s*h,_(n,2*r+2*i+1),n[2*r+2*i+1]+=a*u,_(n,2*r+2*i+1),n[2*r+2*i+2]+=s*u,_(n,2*r+2*i+2)}for(r=0;r<t;r++)n[r]=n[2*r+1]<<16|n[2*r];for(r=t;r<2*t;r++)n[r]=0;return new o(n,0)},e.A=function(e){return v(this,e).h},e.and=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)&e.i(r);return new o(n,this.h&e.h)},e.or=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)|e.i(r);return new o(n,this.h|e.h)},e.xor=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)^e.i(r);return new o(n,this.h^e.h)},t.prototype.digest=t.prototype.v,t.prototype.reset=t.prototype.s,t.prototype.update=t.prototype.u,i=s.Md5=t,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.A,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=l,o.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if(2>(n=n||10)||36<n)throw Error("radix out of range: "+n);
1if("-"==t.charAt(0))return m(e(t.substring(1),n));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var r=l(Math.pow(n,8)),i=c,o=0;o<t.length;o+=8){var s=Math.min(8,t.length-o),a=parseInt(t.substring(o,o+s),n);8>s?(s=l(Math.pow(n,s)),i=i.j(s).add(l(a))):i=(i=i.j(r)).add(l(a))}return i},r=s.Integer=o}).apply(void 0!==o?o:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}).call(this,n(10))}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.